Class BasicResponseMappingStrategy
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.saml.impl.BasicResponseMappingStrategy
- All Implemented Interfaces:
MappingStrategy<ResponseData>,ResponseMappingStrategy,Component,DestructableComponent,InitializableComponent
public class BasicResponseMappingStrategy
extends AbstractInitializableComponent
implements ResponseMappingStrategy
Basic SAML 2 Response strategy to map to data connector output requirements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFlag indicating whether to filter attributes.private ReloadableService<AttributeFilter>AttributeFilter service.private final org.slf4j.LoggerLogger.private MetadataResolverMetadataResolver.private RoleDescriptorResolverRole descriptor resolver.AttributeTranscoderRegistry service. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate Collection<IdPAttribute>filterAssertionResults(List<IdPAttribute> assertionResults, String assertionIssuerID, ProfileRequestContext profileContext, ResponseData responseData) Filter the decoded attributes from an Assertion.Get the instance ofAttributeFilterservice to use.Get the instance ofMetadataResolverto use.Get the role descriptor resolver.Get the instance ofAttributeTranscoderRegistryservice to use.booleanGet the flag indicating whether to filter attributes.map(ResponseData responseData) Maps the given results to a collection ofIdPAttributeindexed by the attribute's ID.private voidpopulateFilterContext(AttributeFilterContext filterContext, Map<String, IdPAttribute> unfilteredAttributes, String assertionIssuer, ResponseData responseData) Populate theAttributeFilterContextfor processing.private Collection<IdPAttribute>processAssertionFiltering(Assertion assertion, List<IdPAttribute> assertionResults, String assertionIssuerID, ProfileRequestContext profileContext, ResponseData responseData) Process filtering the attributes of an Assertion.private AttributeAuthorityDescriptorresolveAuthorityRoleDescriptor(String authorityEntityID) Resolve the attribute authority role descriptor.private SAMLMetadataContextresolveIssuerMetadataContext(ResponseData responseData, String assertionIssuer) Resolve theSAMLMetadataContextfor the assertion issuer.private SAMLPeerEntityContextresolvePeerEntityContext(ResponseData responseData) Resolve the response issuer'sSAMLPeerEntityContext.private StringresolveSelfEntityID(ResponseData responseData) Resolve the self entityID used for the original attribute query.voidSet the instance ofAttributeFilterservice to use.voidsetFilterAttributes(boolean flag) Set the flag indicating whether to filter attributes.voidsetMetadataResolver(MetadataResolver resolver) Set the instance ofMetadataResolverto use.voidSet the role descriptor resolver.voidSet the instance ofAttributeTranscoderRegistryservice to use.private List<IdPAttribute>transcodeAttribute(Attribute samlAttribute, ProfileRequestContext profileContext) Transcode a specifiedAttributeinto a list ofIdPAttribute.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logLogger. -
transcoderService
AttributeTranscoderRegistry service. -
metadataResolver
MetadataResolver. -
roleDescriptorResolver
Role descriptor resolver. -
filterService
AttributeFilter service. -
filterAttributes
private boolean filterAttributesFlag indicating whether to filter attributes.
-
-
Constructor Details
-
BasicResponseMappingStrategy
public BasicResponseMappingStrategy()
-
-
Method Details
-
getTranscoderService
Get the instance ofAttributeTranscoderRegistryservice to use.- Returns:
- the transcoder registry service
-
getMetadataResolver
Get the instance ofMetadataResolverto use.- Returns:
- the metadata resolver
-
setMetadataResolver
Set the instance ofMetadataResolverto use.- Parameters:
resolver- the metadata resolver
-
getRoleDescriptorResolver
Get the role descriptor resolver.- Returns:
- the role descriptor resolver
-
setRoleDescriptorResolver
Set the role descriptor resolver.- Parameters:
resolver- the role descriptor resolver
-
getAttributeFilterService
Get the instance ofAttributeFilterservice to use.- Returns:
- the attribute filter service
-
isFilterAttributes
public boolean isFilterAttributes()Get the flag indicating whether to filter attributes.- Returns:
- true if attributes should be filter, otherwise false
-
setFilterAttributes
public void setFilterAttributes(boolean flag) Set the flag indicating whether to filter attributes.- Parameters:
flag- true if attributes should be filter, otherwise false
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
map
@Nullable public Map<String,IdPAttribute> map(@Nonnull ResponseData responseData) throws ResolutionException Maps the given results to a collection ofIdPAttributeindexed by the attribute's ID.- Specified by:
mapin interfaceMappingStrategy<ResponseData>- Parameters:
responseData- to map- Returns:
- the mapped attributes or null if none exist
- Throws:
ResolutionException- thrown if there is a problem reading data or mapping it
-
transcodeAttribute
@Nonnull private List<IdPAttribute> transcodeAttribute(@Nonnull Attribute samlAttribute, @Nullable ProfileRequestContext profileContext) Transcode a specifiedAttributeinto a list ofIdPAttribute.- Parameters:
samlAttribute- the SAML Attribute to transcodeprofileContext- the profile request context being processed, if available- Returns:
- collection of transcoded attributes
-
processAssertionFiltering
@Nonnull private Collection<IdPAttribute> processAssertionFiltering(@Nonnull Assertion assertion, @Nonnull List<IdPAttribute> assertionResults, @Nullable String assertionIssuerID, @Nullable ProfileRequestContext profileContext, @Nonnull ResponseData responseData) Process filtering the attributes of an Assertion.- Parameters:
assertion- the assertion being processedassertionResults- the decoded attributes of an AssertionassertionIssuerID- the Assertion issuer IDprofileContext- the profile request being processedresponseData- the Response data being processed- Returns:
- the results of filtering for the assertion's attributes
-
filterAssertionResults
@Nonnull private Collection<IdPAttribute> filterAssertionResults(@Nonnull List<IdPAttribute> assertionResults, @Nonnull String assertionIssuerID, @Nonnull ProfileRequestContext profileContext, @Nonnull ResponseData responseData) Filter the decoded attributes from an Assertion.- Parameters:
assertionResults- the decoded attributes of an AssertionassertionIssuerID- the Assertion issuer IDprofileContext- the profile request being processedresponseData- the Response data being processed- Returns:
- the filtered attributes
-
populateFilterContext
private void populateFilterContext(@Nonnull AttributeFilterContext filterContext, @Nonnull Map<String, IdPAttribute> unfilteredAttributes, @Nonnull String assertionIssuer, @Nonnull ResponseData responseData) Populate theAttributeFilterContextfor processing.- Parameters:
filterContext- the filter context to populateunfilteredAttributes- the unfiltered attributesassertionIssuer- issuer of the Assertion being processedresponseData- the response data being processed
-
resolveSelfEntityID
Resolve the self entityID used for the original attribute query.- Parameters:
responseData- the response data being processed- Returns:
- the self entityID
-
resolveIssuerMetadataContext
@Nonnull private SAMLMetadataContext resolveIssuerMetadataContext(@Nonnull ResponseData responseData, @Nonnull String assertionIssuer) Resolve theSAMLMetadataContextfor the assertion issuer.- Parameters:
responseData- the response data being processedassertionIssuer- issuer of the Assertion being processed- Returns:
- the resolved SAMLMetadataContext instance
-
resolvePeerEntityContext
Resolve the response issuer'sSAMLPeerEntityContext.- Parameters:
responseData- the response data being processed- Returns:
- the self entityID
-
resolveAuthorityRoleDescriptor
@Nullable private AttributeAuthorityDescriptor resolveAuthorityRoleDescriptor(@Nonnull String authorityEntityID) Resolve the attribute authority role descriptor.- Parameters:
authorityEntityID- the entityID of the attribute authority being processed- Returns:
- the the role descriptor of the attribute authority being processed, or null if not available
-