Package org.opensaml.saml.saml2.profile
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
- All Implemented Interfaces:
Predicate<ProfileRequestContext>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,FormatSpecificNameIdentifierGenerator<NameID>,NameIdentifierGenerator<NameID>,SAML2NameIDGenerator
public abstract class AbstractSAML2NameIDGenerator
extends AbstractNameIdentifierGenerator<NameID>
implements SAML2NameIDGenerator
Abstract base class for simple implementations of
SAML2NameIDGenerator.
This class is suitable for implementing generators that produce simple kinds of identifiers. It supports various options controlling the inclusion of qualifier attributes.
Subclasses must override one of doGenerate(ProfileRequestContext) or
AbstractNameIdentifierGenerator.getIdentifier(ProfileRequestContext).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private final SAMLObjectBuilder<NameID>Builder for objects.private Function<ProfileRequestContext,AuthnRequest> Strategy used to locate anAuthnRequestto check. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected NameIDdoGenerate(ProfileRequestContext profileRequestContext) Override this method to fully control the generation process.protected StringgetEffectiveSPNameQualifier(ProfileRequestContext profileRequestContext) Get the effective SPNameQualifier to apply based on the properties set and the current request.voidSet the strategy used to locate theAuthnRequestto check for aNameIDPolicy.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, testMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface org.opensaml.saml.saml2.profile.SAML2NameIDGenerator
generate
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
nameBuilder
Builder for objects. -
requestLookupStrategy
Strategy used to locate anAuthnRequestto check.
-
-
Constructor Details
-
AbstractSAML2NameIDGenerator
protected AbstractSAML2NameIDGenerator()Constructor.
-
-
Method Details
-
setRequestLookupStrategy
public void setRequestLookupStrategy(@Nonnull Function<ProfileRequestContext, AuthnRequest> strategy) Set the strategy used to locate theAuthnRequestto check for aNameIDPolicy.- Parameters:
strategy- lookup strategy
-
doGenerate
@Nullable protected NameID doGenerate(@Nonnull ProfileRequestContext profileRequestContext) throws SAMLException Override this method to fully control the generation process.- Specified by:
doGeneratein classAbstractNameIdentifierGenerator<NameID>- Parameters:
profileRequestContext- current profile request context- Returns:
- the generated object
- Throws:
SAMLException- if an error occurs
-
getEffectiveSPNameQualifier
@Nullable protected String getEffectiveSPNameQualifier(@Nonnull ProfileRequestContext profileRequestContext) Get the effective SPNameQualifier to apply based on the properties set and the current request.- Overrides:
getEffectiveSPNameQualifierin classAbstractNameIdentifierGenerator<NameID>- Parameters:
profileRequestContext- current profile context- Returns:
- the effective NameQualifier to set, or null
-