Class NameIdentifierCanonicalization
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor
net.shibboleth.idp.saml.nameid.NameIDCanonicalizationFlowDescriptor
net.shibboleth.idp.saml.nameid.AbstractNameIDCanonicalizer
net.shibboleth.idp.saml.nameid.impl.NameIdentifierCanonicalization
- All Implemented Interfaces:
Function<SubjectCanonicalizationContext,,String> Predicate<ProfileRequestContext>,SubjectCanonicalizer,FlowDescriptor,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
A
SubjectCanonicalizer that transforms the input Subject
into a principal name by searching for one and only one NameIdentifierPrincipal custom principal,
using an injected NameIdentifierDecoder to carry out the process.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NameIdentifierDecoderSupplies logic for decoding theNameIdentifierinto a principal.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdoApply(SubjectCanonicalizationContext c14nContext) Performs c14n if possible.protected voidprivate booleanformatMatches(SubjectCanonicalizationContext c14nContext, String format) Check the format against the relevant flow descriptor's format list.Get the class responsible for decoding theNameIdentifierinto a principal.private NameIdentifierPrincipalgetNameIdentifierPrincipal(SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyNameIdentifierPrincipalprovided it matches a valid Format, returning null otherwise.voidsetDecoder(NameIdentifierDecoder theDecoder) Set the class responsible for decoding theNameIdentifierinto a principal.Methods inherited from class net.shibboleth.idp.saml.nameid.AbstractNameIDCanonicalizer
apply, getLogPrefixMethods inherited from class net.shibboleth.idp.saml.nameid.NameIDCanonicalizationFlowDescriptor
getFormats, setFormatsMethods inherited from class net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor
equals, getFlowId, hashCode, setActivationCondition, setFlowId, test, toStringMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
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, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiableComponent
setIdMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
decoder
Supplies logic for decoding theNameIdentifierinto a principal.
-
-
Constructor Details
-
NameIdentifierCanonicalization
public NameIdentifierCanonicalization()
-
-
Method Details
-
getDecoder
Get the class responsible for decoding theNameIdentifierinto a principal.- Returns:
- the decoder
-
setDecoder
Set the class responsible for decoding theNameIdentifierinto a principal.- Parameters:
theDecoder- the decoder
-
doInitialize
- Overrides:
doInitializein classAbstractNameIDCanonicalizer- Throws:
ComponentInitializationException
-
doApply
Performs c14n if possible.- Specified by:
doApplyin classAbstractNameIDCanonicalizer- Parameters:
c14nContext- the current subject canonicalization context- Returns:
- event indicating result of function
-
getNameIdentifierPrincipal
@Nullable private NameIdentifierPrincipal getNameIdentifierPrincipal(@Nonnull SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyNameIdentifierPrincipalprovided it matches a valid Format, returning null otherwise.- Parameters:
c14nContext- input context- Returns:
- the only matching principal or null
-
formatMatches
private boolean formatMatches(@Nonnull SubjectCanonicalizationContext c14nContext, @Nonnull String format) Check the format against the relevant flow descriptor's format list.- Parameters:
c14nContext- the current c14n contextformat- the format to check- Returns:
- true iff the format matches
-