Class SoapAMTokenValidator

  • All Implemented Interfaces:
    org.apache.cxf.sts.token.validator.TokenValidator

    public class SoapAMTokenValidator
    extends Object
    implements org.apache.cxf.sts.token.validator.TokenValidator
    Instances of this class will be deployed in a published soap-sts instance when the soap-sts instance is configured to support delegated token relationships (ActAs/OnBehalfOf) and OpenAM token types are configured as one of the validated delegated token types. This class validates OpenAM tokens by making a Rest call to OpenAM to obtain the principal corresponding to the session id. Part of establishing this correlation in OpenAM includes determining that the session id is valid. This class is not in the wss package, and is not implemented via classes in the disp and uri packages because it is not explicitly consuming the OpenAM Rest authN context, but rather consumes a standard OpenAM Rest interface to correlate a session id to a principal. In other words, the disp and uri packages have to do with dispatching an invocation against the authN module specified in the AuthTargetMapping state of the published STS instance. Validating an OpenAM session id does not involve consuming REST authN, but rather consuming a standard OpenAM REST endpoint which will take a session id, and return the associated principal, and throw an exception if the session id was invalid. And note that the structure of the OpenAM token is the same as produced by the OpenAMSessionAssertion. In other words, when an OpenAM session id is used to traverse a SecurityPolicy binding specifying an OpenAMSessionAssertion, the OpenAM session id will be encapsulated in a BinarySecurityToken as produced by the OpenAMSessionAssertion class. Likewise, when an OpenAM session id is used in the ActAs/OnBehalfOf in the issue operation (necessary to produce SAML2 SV assertions), then the client will have to use this same format to encapsulate the OpenAM session id. This format is produced by TokenSpecification#openAMSessionTokenSaml2SenderVouches method in the openam-soap-sts-client module.
    • Method Detail

      • canHandleToken

        public boolean canHandleToken​(org.apache.cxf.sts.request.ReceivedToken validateTarget)
        Specified by:
        canHandleToken in interface org.apache.cxf.sts.token.validator.TokenValidator
        Parameters:
        validateTarget - the to-be-validated token
        Returns:
        whether this TokenValidator instance can validate this type of token
      • canHandleToken

        public boolean canHandleToken​(org.apache.cxf.sts.request.ReceivedToken validateTarget,
                                      String realm)
        Specified by:
        canHandleToken in interface org.apache.cxf.sts.token.validator.TokenValidator
        Parameters:
        validateTarget - the to-be-validated token
        realm - CXF-STS construct to segment TokenValidator instances. Unused.
        Returns:
        whether this TokenValidator instance can validate this type of token
      • validateToken

        public org.apache.cxf.sts.token.validator.TokenValidatorResponse validateToken​(org.apache.cxf.sts.token.validator.TokenValidatorParameters tokenParameters)
        Specified by:
        validateToken in interface org.apache.cxf.sts.token.validator.TokenValidator
        Parameters:
        tokenParameters - the state necessary for token validation
        Returns:
        an instance of the TokenValidatorResponse class which indicates whether the token was successfully validated.