Class AbstractSAML2NameIDTranscoder<EncodedType extends IdPAttributeValue>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder<AttributeType>
net.shibboleth.idp.saml.attribute.transcoding.AbstractSAMLAttributeTranscoder<NameID,EncodedType>
net.shibboleth.idp.saml.saml2.nameid.transcoding.AbstractSAML2NameIDTranscoder<EncodedType>
- Type Parameters:
EncodedType- the type of data that can be handled by the transcoder
- All Implemented Interfaces:
AttributeTranscoder<NameID>,SAML2NameIDTranscoder<EncodedType>,Component,DestructableComponent,InitializableComponent
- Direct Known Subclasses:
SAML2ScopedStringNameIDTranscoder,SAML2StringNameIDTranscoder
public abstract class AbstractSAML2NameIDTranscoder<EncodedType extends IdPAttributeValue>
extends AbstractSAMLAttributeTranscoder<NameID,EncodedType>
implements SAML2NameIDTranscoder<EncodedType>
Base class for transcoders that operate on a SAML 2
NameID.
For the moment, these are decode only, as the encoding side was already handled with a dedicated generation service. The registry concept came later.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA function to produce a "canonical" name for a SAML 2.0NameIDfor transcoding rules. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,String> Function used to obtain the issuer ID.private Function<ProfileRequestContext,String> Function used to obtain the requester ID.Fields inherited from interface net.shibboleth.idp.saml.saml2.nameid.transcoding.SAML2NameIDTranscoder
PROP_DEFAULT_QUALIFIERS, PROP_NAME_FORMAT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected NameIDbuildAttribute(ProfileRequestContext profileRequestContext, IdPAttribute attribute, Class<? extends NameID> to, TranscodingRule rule, List<XMLObject> attributeValues) Builds a SAML attribute element from the given attribute values.protected IdPAttributebuildIdPAttribute(ProfileRequestContext profileRequestContext, NameID nameID, TranscodingRule rule, List<IdPAttributeValue> attributeValues) Builds anIdPAttributefrom the given values.protected voidGet the name of the encoded object that would be created by a given set of instructions.Get the class representing the type of object supported by this transcoder.protected StringgetNameQualifier(ProfileRequestContext profileRequestContext, NameID input, boolean useDefaultQualifier) Compute the effective NameQualifier to use based on both the input and the transaction.protected StringgetSPNameQualifier(ProfileRequestContext profileRequestContext, NameID input, boolean useDefaultQualifier) Compute the effective SPNameQualifier to use based on both the input and the transaction.Returns the values to decode from the concrete input object.voidSet the strategy used to locate the name of the identity provider in this transaction.voidSet the strategy used to locate the name of the service provider in this transaction.Methods inherited from class net.shibboleth.idp.saml.attribute.transcoding.AbstractSAMLAttributeTranscoder
canEncodeValue, decodeValue, doDecode, doEncode, encodeValue, getStringValueMethods inherited from class net.shibboleth.idp.attribute.transcoding.AbstractAttributeTranscoder
decode, encode, getNameFromMetadata, setActivationCondition, setNameFromMetadataLookupStrategyMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.idp.attribute.transcoding.AttributeTranscoder
decode, encodeMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
serviceProviderNameLookupStrategy
Function used to obtain the requester ID. -
identityProviderNameLookupStrategy
Function used to obtain the issuer ID.
-
-
Constructor Details
-
AbstractSAML2NameIDTranscoder
public AbstractSAML2NameIDTranscoder()Constructor.
-
-
Method Details
-
setServiceProviderNameLookupStrategy
public void setServiceProviderNameLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Set the strategy used to locate the name of the service provider in this transaction.- Parameters:
strategy- lookup strategy
-
setIdentityProviderNameLookupStrategy
public void setIdentityProviderNameLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Set the strategy used to locate the name of the identity provider in this transaction.- Parameters:
strategy- lookup strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getEncodedType
Get the class representing the type of object supported by this transcoder.- Specified by:
getEncodedTypein interfaceAttributeTranscoder<EncodedType extends IdPAttributeValue>- Returns:
- object type supported
-
getEncodedName
Get the name of the encoded object that would be created by a given set of instructions.- Specified by:
getEncodedNamein interfaceAttributeTranscoder<EncodedType extends IdPAttributeValue>- Parameters:
rule- properties governing the encoding process- Returns:
- a canonical name for objects produced by this transcoder for the given instructions
-
buildAttribute
@Nonnull protected NameID buildAttribute(@Nullable ProfileRequestContext profileRequestContext, @Nullable IdPAttribute attribute, @Nonnull Class<? extends NameID> to, @Nonnull TranscodingRule rule, @Nonnull List<XMLObject> attributeValues) throws AttributeEncodingException Builds a SAML attribute element from the given attribute values.- Specified by:
buildAttributein classAbstractSAMLAttributeTranscoder<NameID,EncodedType extends IdPAttributeValue> - Parameters:
profileRequestContext- current profile requestattribute- the attribute being encodedto- target type to createrule- properties to control encodingattributeValues- the encoded values for the attribute- Returns:
- the SAML attribute object
- Throws:
AttributeEncodingException- thrown if there is a problem constructing the SAML attribute
-
buildIdPAttribute
@Nonnull protected IdPAttribute buildIdPAttribute(@Nullable ProfileRequestContext profileRequestContext, @Nonnull NameID nameID, @Nonnull TranscodingRule rule, @Nonnull List<IdPAttributeValue> attributeValues) throws AttributeDecodingException Builds anIdPAttributefrom the given values.- Specified by:
buildIdPAttributein classAbstractSAMLAttributeTranscoder<NameID,EncodedType extends IdPAttributeValue> - Parameters:
profileRequestContext- current profile requestnameID- the attribute being decodedrule- properties to control decodingattributeValues- the decoded values for the attribute- Returns:
- the IdPAttribute object
- Throws:
AttributeDecodingException- thrown if there is a problem constructing the IdPAttribute
-
getValues
Returns the values to decode from the concrete input object.- Specified by:
getValuesin classAbstractSAMLAttributeTranscoder<NameID,EncodedType extends IdPAttributeValue> - Parameters:
input- input object- Returns:
- values to decode
-
getNameQualifier
@Nonnull protected String getNameQualifier(@Nullable ProfileRequestContext profileRequestContext, @Nonnull NameID input, boolean useDefaultQualifier) Compute the effective NameQualifier to use based on both the input and the transaction.- Parameters:
profileRequestContext- profile request contextinput- input objectuseDefaultQualifier- true iff the qualifier should be defaulted in if not set- Returns:
- the effective NameQualifier to use
-
getSPNameQualifier
@Nonnull protected String getSPNameQualifier(@Nullable ProfileRequestContext profileRequestContext, @Nonnull NameID input, boolean useDefaultQualifier) Compute the effective SPNameQualifier to use based on both the input and the transaction.- Parameters:
profileRequestContext- profile request contextinput- input objectuseDefaultQualifier- true iff the qualifier should be defaulted in if not set- Returns:
- the effective NameQualifier to use
-