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 Details

  • Constructor Details

    • BasicResponseMappingStrategy

      public BasicResponseMappingStrategy()
  • Method Details

    • getTranscoderService

      Get the instance of AttributeTranscoderRegistry service to use.
      Returns:
      the transcoder registry service
    • setTranscoderService

      public void setTranscoderService(@Nullable ReloadableService<AttributeTranscoderRegistry> service)
      Set the instance of AttributeTranscoderRegistry service to use.
      Parameters:
      service - the transcoder registry service
    • getMetadataResolver

      @NonnullAfterInit public MetadataResolver getMetadataResolver()
      Get the instance of MetadataResolver to use.
      Returns:
      the metadata resolver
    • setMetadataResolver

      public void setMetadataResolver(@Nullable MetadataResolver resolver)
      Set the instance of MetadataResolver to use.
      Parameters:
      resolver - the metadata resolver
    • getRoleDescriptorResolver

      @NonnullAfterInit public RoleDescriptorResolver getRoleDescriptorResolver()
      Get the role descriptor resolver.
      Returns:
      the role descriptor resolver
    • setRoleDescriptorResolver

      public void setRoleDescriptorResolver(@Nullable RoleDescriptorResolver resolver)
      Set the role descriptor resolver.
      Parameters:
      resolver - the role descriptor resolver
    • getAttributeFilterService

      public ReloadableService<AttributeFilter> getAttributeFilterService()
      Get the instance of AttributeFilter service to use.
      Returns:
      the attribute filter service
    • setAttributeFilterService

      public void setAttributeFilterService(@Nullable ReloadableService<AttributeFilter> service)
      Set the instance of AttributeFilter service to use.
      Parameters:
      service - 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

      protected void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException
    • map

      @Nullable public Map<String,IdPAttribute> map(@Nonnull ResponseData responseData) throws ResolutionException
      Maps the given results to a collection of IdPAttribute indexed by the attribute's ID.
      Specified by:
      map in interface MappingStrategy<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 specified Attribute into a list of IdPAttribute.
      Parameters:
      samlAttribute - the SAML Attribute to transcode
      profileContext - 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 processed
      assertionResults - the decoded attributes of an Assertion
      assertionIssuerID - the Assertion issuer ID
      profileContext - the profile request being processed
      responseData - 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 Assertion
      assertionIssuerID - the Assertion issuer ID
      profileContext - the profile request being processed
      responseData - 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 the AttributeFilterContext for processing.
      Parameters:
      filterContext - the filter context to populate
      unfilteredAttributes - the unfiltered attributes
      assertionIssuer - issuer of the Assertion being processed
      responseData - the response data being processed
    • resolveSelfEntityID

      @Nullable private String resolveSelfEntityID(@Nonnull ResponseData responseData)
      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 the SAMLMetadataContext for the assertion issuer.
      Parameters:
      responseData - the response data being processed
      assertionIssuer - issuer of the Assertion being processed
      Returns:
      the resolved SAMLMetadataContext instance
    • resolvePeerEntityContext

      @Nonnull private SAMLPeerEntityContext resolvePeerEntityContext(@Nonnull ResponseData responseData)
      Resolve the response issuer's SAMLPeerEntityContext.
      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