Class NameIDCanonicalization
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.NameIDCanonicalization
- 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 NameIDPrincipal custom principal,
using an injected NameIDDecoder to carry out the process.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NameIDDecoderSupplies logic for decoding theNameIDinto a principal.private 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 theXSString.getValue()into a principal.private NameIDPrincipalgetNameIDPrincipal(SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyNameIDPrincipalprovided it matches a valid Format, returning null otherwise.voidsetDecoder(NameIDDecoder theDecoder) Set the class responsible for decoding theXSString.getValue()into 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 org.slf4j.Logger logClass logger. -
decoder
Supplies logic for decoding theNameIDinto a principal.
-
-
Constructor Details
-
NameIDCanonicalization
public NameIDCanonicalization()
-
-
Method Details
-
getDecoder
Get the class responsible for decoding theXSString.getValue()into a principal.- Returns:
- the decoder
-
setDecoder
Set the class responsible for decoding theXSString.getValue()into 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
-
getNameIDPrincipal
@Nullable private NameIDPrincipal getNameIDPrincipal(@Nonnull SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyNameIDPrincipalprovided 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
-