Package net.shibboleth.idp.saml.nameid

# Class AbstractSAML2NameIDGenerator

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
org.opensaml.saml.common.profile.AbstractNameIdentifierGenerator<NameID>
org.opensaml.saml.saml2.profile.AbstractSAML2NameIDGenerator
net.shibboleth.idp.saml.nameid.AbstractSAML2NameIDGenerator

All Implemented Interfaces:
  `Predicate<ProfileRequestContext>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `FormatSpecificNameIdentifierGenerator<NameID>`, `NameIdentifierGenerator<NameID>`, `SAML2NameIDGenerator`

Direct Known Subclasses:
  `AttributeSourcedSAML2NameIDGenerator`, `PersistentSAML2NameIDGenerator`, `TransientSAML2NameIDGenerator`

public class AbstractSAML2NameIDGenerator extends AbstractSAML2NameIDGenerator
IdP-specific base class for SAML 2.0 NameID generation that extends the OpenSAML base class with support for `BrowserSSOProfileConfiguration.getSPNameQualifier(org.opensaml.profile.context.ProfileRequestContext)`.

Since:
  5.0.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,RelyingPartyContext>`
`relyingPartyContextLookupStrategy`
Strategy function to lookup RelyingPartyContext.
`private Function<ProfileRequestContext,AuthnRequest>`
`requestLookupStrategy`
Strategy used to locate an `AuthnRequest` to check.

## Constructor Summary

Constructors
Constructor
Description
`AbstractSAML2NameIDGenerator()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected String`
`getEffectiveSPNameQualifier(ProfileRequestContext profileRequestContext)`
`void`
`setRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)`
Set the lookup strategy to use to locate the `RelyingPartyContext`.
`void`
`setRequestLookupStrategy(Function<ProfileRequestContext,AuthnRequest> strategy)`
Set the strategy used to locate the `AuthnRequest` to check for a `NameIDPolicy`.

### Methods inherited from class org.opensaml.saml.saml2.profile.AbstractSAML2NameIDGenerator

`doGenerate`

### Methods inherited from class org.opensaml.saml.common.profile.AbstractNameIdentifierGenerator

`generate, getDefaultIdPNameQualifierLookupStrategy, getDefaultSPNameQualifierLookupStrategy, getEffectiveIdPNameQualifier, getFormat, getIdentifier, getIdPNameQualifier, getSPNameQualifier, getSPProvidedID, isOmitQualifiers, setActivationCondition, setDefaultIdPNameQualifierLookupStrategy, setDefaultSPNameQualifierLookupStrategy, setFormat, setIdPNameQualifier, setOmitQualifiers, setSPNameQualifier, setSPProvidedId, test`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface java.util.function.Predicate

`and, negate, or`

### Methods inherited from interface org.opensaml.saml.saml2.profile.SAML2NameIDGenerator

`generate`

## Field Details

### relyingPartyContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
Strategy function to lookup RelyingPartyContext.

### requestLookupStrategy

@Nonnull private Function<ProfileRequestContext,AuthnRequest> requestLookupStrategy
Strategy used to locate an `AuthnRequest` to check.

## Constructor Details

### AbstractSAML2NameIDGenerator

public AbstractSAML2NameIDGenerator()
Constructor.

## Method Details

### setRequestLookupStrategy

public void setRequestLookupStrategy(@Nonnull Function<ProfileRequestContext,AuthnRequest> strategy)
Set the strategy used to locate the `AuthnRequest` to check for a `NameIDPolicy`.

Overrides:
  `setRequestLookupStrategy` in class `AbstractSAML2NameIDGenerator`
Parameters:
  `strategy` - lookup strategy

### setRelyingPartyContextLookupStrategy

public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)
Set the lookup strategy to use to locate the `RelyingPartyContext`.

Parameters:
  `strategy` - lookup function to use

### getEffectiveSPNameQualifier

@Nullable protected String getEffectiveSPNameQualifier(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `getEffectiveSPNameQualifier` in class `AbstractSAML2NameIDGenerator`