Class AttributeSourcedAuthnContextTranslationStrategy
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.saml.saml2.profile.config.AttributeSourcedAuthnContextTranslationStrategy
- All Implemented Interfaces:
Function<ProfileRequestContext,,Collection<Principal>> Component,DestructableComponent,InitializableComponent
public class AttributeSourcedAuthnContextTranslationStrategy
extends AbstractInitializableComponent
implements Function<ProfileRequestContext,Collection<Principal>>
Implementation of the SSO authnContextTranslationStrategyEx hook that translates decoded
IdPAttribute values into (optionally mapped) values in the form of AuthnContextClassRefPrincipal
objects.
This is primarily used for proxying via SAML to non-compliant IdPs (i.e., virtually all of them) that can't be bothered to properly support the use of Authentication Context to carry what it was literally designed to carry.
-
Field Summary
FieldsModifier and TypeFieldDescriptionLookup strategy for AttributeContext to pull from.Attribute sources to pull from.private final org.slf4j.LoggerClass logger.Translation map to convert values if necessary. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddMappedValues(Set<Principal> results, IdPAttribute source) apply(ProfileRequestContext input) voidSets the lookup strategy for theAttributeContextto pull from.voidsetAttributeSourceIDs(Collection<String> sources) Sets the names of theIdPAttributeobjects to check for values to map in.voidsetMappings(Map<String, Principal> mappings) Sets the mappings to transformStringAttributeValuedata into different values for use asPrincipalobjects.voidsetValueMappings(Map<String, String> mappings) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
attributeContextLookupStrategy
Lookup strategy for AttributeContext to pull from. -
attributeSourceIDs
Attribute sources to pull from. -
valueMappings
Translation map to convert values if necessary.
-
-
Constructor Details
-
AttributeSourcedAuthnContextTranslationStrategy
public AttributeSourcedAuthnContextTranslationStrategy()Constructor.
-
-
Method Details
-
setAttributeContextLookupStrategy
public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext, AttributeContext> strategy) Sets the lookup strategy for theAttributeContextto pull from.- Parameters:
strategy- lookup strategy
-
setAttributeSourceIDs
Sets the names of theIdPAttributeobjects to check for values to map in.- Parameters:
sources-IdPAttributeIDs to check for
-
setValueMappings
@Deprecated(since="5.2.0", forRemoval=true) public void setValueMappings(@Nullable Map<String, String> mappings) Deprecated, for removal: This API element is subject to removal in a future version.Sets the mappings to transformStringAttributeValuedata into different values for use asAuthnContextClassRefPrincipalobjects.Note that null keys are ignored, but null values are allowed, which suppresses the mapping of a value caising it to be skipped. Also, keys are not trimmed, but values are, to ensure the result is a valid context class reference.
This is deprecated in favor of the type-neutral variant.
- Parameters:
mappings- the value mappings
-
setMappings
Sets the mappings to transformStringAttributeValuedata into different values for use asPrincipalobjects.Note that null keys are ignored, but null values are allowed, which suppresses the mapping of a value caising it to be skipped. Also, keys are not trimmed, but values are, to ensure the result is a valid context class reference.
- Parameters:
mappings- the value mappings
-
apply
- Specified by:
applyin interfaceFunction<ProfileRequestContext,Collection<Principal>>
-
addMappedValues
-