Class SAMLPeerEntityContext

All Implemented Interfaces:
Iterable<BaseContext>

public final class SAMLPeerEntityContext extends AbstractAuthenticatableSAMLEntityContext
Subcontext that carries information about a SAML peer entity.

This context will often contain subcontexts, whose data is construed to be scoped to that peer entity.

The method getEntityId() will attempt to dynamically resolve the appropriate data from the SAML message held in the message context if the data has not been set statically by the corresponding setter method. This evaluation will be attempted only if the this context instance is an immediate child of the message context, as returned by BaseContext.getParent().

  • Field Details

    • log

      @Nonnull private org.slf4j.Logger log
      Logger.
    • useSAML1QueryResourceAsEntityId

      private boolean useSAML1QueryResourceAsEntityId
      Whether to use the resource of SAML 1 queries to resolve the entity ID.
  • Constructor Details

    • SAMLPeerEntityContext

      public SAMLPeerEntityContext()
      Constructor.
  • Method Details

    • getEntityId

      @Nullable @NotEmpty public String getEntityId()
      Gets the entityId of the SAML entity.
      Overrides:
      getEntityId in class AbstractSAMLEntityContext
      Returns:
      entityId of the SAML entity, may be null
    • getUseSAML1QueryResourceAsEntityId

      public boolean getUseSAML1QueryResourceAsEntityId()
      Gets whether to use the Resource attribute of some SAML 1 queries to resolve the entity ID.
      Returns:
      whether to use the Resource attribute of some SAML 1 queries to resolve the entity ID
    • setUseSAML1QueryResourceAsEntityId

      public void setUseSAML1QueryResourceAsEntityId(boolean useResource)
      Sets whether to use the Resource attribute of some SAML 1 queries to resolve the entity ID.
      Parameters:
      useResource - whether to use the Resource attribute of some SAML 1 queries to resolve the entity ID
    • resolveEntityId

      @Nullable protected String resolveEntityId()
      Dynamically resolve the SAML peer entity ID from the SAML protocol message held in MessageContext.getMessage().
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml2Request

      @Nullable protected String processSaml2Request(@Nonnull RequestAbstractType request)
      Resolve the SAML entity ID from a SAML 2 request.
      Parameters:
      request - the request
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml2Response

      @Nullable protected String processSaml2Response(@Nonnull StatusResponseType statusResponse)
      Resolve the SAML entity ID from a SAML 2 response.
      Parameters:
      statusResponse - the response
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml2ResponseAssertions

      @Nullable protected String processSaml2ResponseAssertions(@Nonnull Response response)
      Resolve the SAML entity ID from the Assertions of a SAML 2 response.
      Parameters:
      response - the response
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml2Issuer

      @Nullable protected String processSaml2Issuer(@Nullable Issuer issuer)
      Resolve the SAML entity ID from a SAML 2 Issuer.
      Parameters:
      issuer - the issuer
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml1Response

      @Nullable protected String processSaml1Response(@Nonnull Response response)
      Resolve the SAML entity ID from a SAML 1 response.
      Parameters:
      response - the response
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml1Request

      @Nullable protected String processSaml1Request(@Nonnull Request request)
      Resolve the SAML entity ID from a SAML 1 request.
      Parameters:
      request - the request
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml1AttributeQuery

      @Nullable protected String processSaml1AttributeQuery(@Nonnull AttributeQuery query)
      Resolve the SAML entity ID from a SAML 1 AttributeQuery.
      Parameters:
      query - the query
      Returns:
      the entity ID, or null if it could not be resolved
    • processSaml1AuthorizationDecisionQuery

      @Nullable protected String processSaml1AuthorizationDecisionQuery(@Nonnull AuthorizationDecisionQuery query)
      Resolve the SAML entityID from a SAML 1 AuthorizationDecisionQuery.
      Parameters:
      query - the query
      Returns:
      the entity ID, or null if it could not be resolved
    • resolveSAMLMessage

      @Nullable protected SAMLObject resolveSAMLMessage()
      Resolve the SAML message from the message context.
      Returns:
      the SAML message, or null if it can not be resolved