Class PersistentSAML2NameIDGenerator
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
org.opensaml.saml.common.profile.AbstractNameIdentifierGenerator<NameID>
org.opensaml.saml.saml2.profile.AbstractSAML2NameIDGenerator
net.shibboleth.idp.saml.nameid.impl.PersistentSAML2NameIDGenerator
- All Implemented Interfaces:
Predicate<ProfileRequestContext>
,Component
,DestructableComponent
,IdentifiableComponent
,IdentifiedComponent
,InitializableComponent
,FormatSpecificNameIdentifierGenerator<NameID>
,NameIdentifierGenerator<NameID>
,SAML2NameIDGenerator
@ThreadSafeAfterInit
public class PersistentSAML2NameIDGenerator
extends AbstractSAML2NameIDGenerator
Generator for "persistent" Format
NameID
objects that provides a source/seed ID based on IdPAttribute
data.-
Field Summary
FieldsModifier and TypeFieldDescriptionStrategy function to lookup AttributeContext.Attribute(s) to use as an identifier source.private DataSource
A DataSource to auto-provision aJDBCPairwiseIdStore
instance.private final org.slf4j.Logger
Class logger.private PairwiseIdStore
Store for IDs.private Function<ProfileRequestContext,
SubjectContext> Strategy function to lookup SubjectContext.private boolean
Predicate to select whether to look at filtered or unfiltered attributes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected String
getIdentifier
(ProfileRequestContext profileRequestContext) void
Set the lookup strategy to use to locate theAttributeContext
.void
setAttributeSourceIds
(List<String> ids) Set the attribute sources to pull from.void
setDataSource
(DataSource source) Set a data source to inject into an auto-provisioned instance ofJDBCPairwiseIdStore
to use as the store.void
Set aPairwiseIdStore
to use.void
Set the lookup strategy to use to locate theSubjectContext
.void
setUseUnfilteredAttributes
(boolean flag) Set whether to source the input attributes from the unfiltered set.Methods inherited from class org.opensaml.saml.saml2.profile.AbstractSAML2NameIDGenerator
doGenerate, getEffectiveSPNameQualifier, setRequestLookupStrategy
Methods inherited from class org.opensaml.saml.common.profile.AbstractNameIdentifierGenerator
generate, getDefaultIdPNameQualifierLookupStrategy, getDefaultSPNameQualifierLookupStrategy, getEffectiveIdPNameQualifier, getFormat, getIdPNameQualifier, getSPNameQualifier, getSPProvidedID, isOmitQualifiers, setActivationCondition, setDefaultIdPNameQualifierLookupStrategy, setDefaultSPNameQualifierLookupStrategy, setFormat, setIdPNameQualifier, setOmitQualifiers, setSPNameQualifier, setSPProvidedId, test
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
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.utilities.java.support.component.IdentifiedComponent
getId
Methods inherited from interface org.opensaml.saml.saml2.profile.SAML2NameIDGenerator
generate
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
subjectContextLookupStrategy
Strategy function to lookup SubjectContext. -
attributeContextLookupStrategy
Strategy function to lookup AttributeContext. -
attributeSourceIds
Attribute(s) to use as an identifier source. -
pidStore
Store for IDs. -
dataSource
A DataSource to auto-provision aJDBCPairwiseIdStore
instance. -
useUnfilteredAttributes
private boolean useUnfilteredAttributesPredicate to select whether to look at filtered or unfiltered attributes.
-
-
Constructor Details
-
PersistentSAML2NameIDGenerator
public PersistentSAML2NameIDGenerator()Constructor.
-
-
Method Details
-
setSubjectContextLookupStrategy
public void setSubjectContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SubjectContext> strategy) Set the lookup strategy to use to locate theSubjectContext
.- Parameters:
strategy
- lookup function to use
-
setAttributeContextLookupStrategy
public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext, AttributeContext> strategy) Set the lookup strategy to use to locate theAttributeContext
.- Parameters:
strategy
- lookup function to use
-
setAttributeSourceIds
Set the attribute sources to pull from.- Parameters:
ids
- attribute IDs to pull from
-
setPersistentIdStore
Set aPairwiseIdStore
to use.- Parameters:
store
- the id store
-
setDataSource
Set a data source to inject into an auto-provisioned instance ofJDBCPairwiseIdStore
to use as the store.- Parameters:
source
- data source
-
setUseUnfilteredAttributes
public void setUseUnfilteredAttributes(boolean flag) Set whether to source the input attributes from the unfiltered set.Defaults to true, since the input is not directly exposed.
- Parameters:
flag
- flag to set
-
doInitialize
- Overrides:
doInitialize
in classAbstractNameIdentifierGenerator<NameID>
- Throws:
ComponentInitializationException
-
getIdentifier
@Nullable protected String getIdentifier(@Nonnull ProfileRequestContext profileRequestContext) throws SAMLException - Overrides:
getIdentifier
in classAbstractNameIdentifierGenerator<NameID>
- Throws:
SAMLException
-