Package org.opensaml.saml.saml2.profile

# Class SAML2ObjectSupport

java.lang.Object
org.opensaml.saml.saml2.profile.SAML2ObjectSupport

public final class SAML2ObjectSupport extends Object
A helper class for working with SAMLObjects.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final org.slf4j.Logger`
`LOG`
Logger.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`SAML2ObjectSupport()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`areNameIDFormatsEquivalent(String format1, String format2)`
Return true iff the two input `NameID` formats are equivalent for SAML 2.0 purposes.
`static boolean`
`areNameIDsEquivalent(NameID name1, NameID name2)`
Return true iff the two input `NameID` objects are equivalent for SAML 2.0 purposes, with the assumption that the qualifier attributes must match exactly.
`static boolean`
`areNameIDsEquivalent(NameID name1, NameID name2, String assertingParty, String relyingParty)`
Return true iff the two input `NameID` objects are equivalent for SAML 2.0 purposes, allowing thw qualifier attributes to assume default values if not otherwise set.
`static boolean`
`matchSubject(Subject target, Subject control)`
Match a target `Subject` against a control instance according to the requirements specified in SAML Core 3.3.4.
`static boolean`
`matchSubject(Subject target, Subject control, boolean processConfirmation)`
Match a target `Subject` against a control instance according to the requirements specified in SAML Core 3.3.4.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### LOG

@Nonnull private static final org.slf4j.Logger LOG
Logger.

## Constructor Details

### SAML2ObjectSupport

private SAML2ObjectSupport()
Constructor.

## Method Details

### areNameIDFormatsEquivalent

public static boolean areNameIDFormatsEquivalent(@Nullable String format1, @Nullable String format2)
Return true iff the two input `NameID` formats are equivalent for SAML 2.0 purposes.

Parameters:
  `format1` - first format to check
  `format2` - second format to check
Returns:
  true iff the two format values should be viewed as equivalent

### areNameIDsEquivalent

public static boolean areNameIDsEquivalent(@Nonnull NameID name1, @Nonnull NameID name2)
Return true iff the two input `NameID` objects are equivalent for SAML 2.0 purposes, with the assumption that the qualifier attributes must match exactly.

Parameters:
  `name1` - first NameID to check
  `name2` - second NameID to check
Returns:
  true iff the two values should be viewed as equivalent

### areNameIDsEquivalent

public static boolean areNameIDsEquivalent(@Nonnull NameID name1, @Nonnull NameID name2, @Nullable String assertingParty, @Nullable String relyingParty)
Return true iff the two input `NameID` objects are equivalent for SAML 2.0 purposes, allowing thw qualifier attributes to assume default values if not otherwise set.

Parameters:
  `name1` - first NameID to check
  `name2` - second NameID to check
  `assertingParty` - optional name of asserting party to default in as NameQualifier
  `relyingParty` - optional name of relying party to default in as SPNameQualifier
Returns:
  true iff the two values should be viewed as equivalent
Since:
  3.4.0

### matchSubject

public static boolean matchSubject(@Nonnull Subject target, @Nonnull Subject control)
Match a target `Subject` against a control instance according to the requirements specified in SAML Core 3.3.4.

Any `EncryptedID` instances which were originally present must have already been decrypted and stored in-place on the Subject. `BaseID` is currently unsupported. Presence of either in either target or control subject will throw `IllegalArgumentException`.

Parameters:
  `target` - the target subject to evaluate
  `control` - the control subject against which to evaluate the target
Returns:
  true if target matches the control, otherwise false
Throws:
  `IllegalArgumentException` - if EncryptedID or BaseID is present in either Subject instance

### matchSubject

public static boolean matchSubject(@Nonnull Subject target, @Nonnull Subject control, boolean processConfirmation)
Match a target `Subject` against a control instance according to the requirements specified in SAML Core 3.3.4.

Any `EncryptedID` instances which were originally present must have already been decrypted and stored in-place on the Subject. `BaseID` is currently unsupported. Presence of either in either target or control subject will throw `IllegalArgumentException`.

Parameters:
  `target` - the target subject to evaluate
  `control` - the control subject against which to evaluate the target
  `processConfirmation` - flag controlling whether to process matching of `SubjectConfirmation`
Returns:
  true if target matches the control, otherwise false
Throws:
  `IllegalArgumentException` - if EncryptedID or BaseID is present in either Subject instance