Class TokenExchangeGrant

    • Constructor Detail

      • TokenExchangeGrant

        public TokenExchangeGrant​(Token subjectToken,
                                  TokenTypeURI subjectTokenType)
        Creates a new token exchange grant.
        Parameters:
        subjectToken - The subject token representing the identity of the party on behalf of whom the request is being made. Must not be null.
        subjectTokenType - Identifier for the type of the subject token. Must not be null.
      • TokenExchangeGrant

        public TokenExchangeGrant​(Token subjectToken,
                                  TokenTypeURI subjectTokenType,
                                  Token actorToken,
                                  TokenTypeURI actorTokenType,
                                  TokenTypeURI requestedTokenType,
                                  List<Audience> audience)
        Creates a new token exchange grant.
        Parameters:
        subjectToken - The subject token representing the identity of the party on behalf of whom the request is being made. Must not be null.
        subjectTokenType - Identifier for the type of the subject token. Must not be null.
        actorToken - Optional token representing the identity of the acting party, null if not specified.
        actorTokenType - Identifier for the type of the actor token, if present.
        requestedTokenType - Optional identifier for the requested type of security token, null if not specified.
        audience - Optional audience for the requested security token, null if not specified.
    • Method Detail

      • getSubjectToken

        public Token getSubjectToken()
        Returns the subject token representing the identity of the party on behalf of whom the request is being made.
        Returns:
        The subject token, null if not specified.
      • getSubjectTokenType

        public TokenTypeURI getSubjectTokenType()
        Returns the identifier for the type of the subject token.
        Returns:
        The subject token type identifier.
      • getActorToken

        public Token getActorToken()
        Returns the optional token representing the identity of the acting party.
        Returns:
        The actor token, null if not specified.
      • getActorTokenType

        public TokenTypeURI getActorTokenType()
        Returns the identifier for the type of the optional actor token, if present.
        Returns:
        The actor token type identifier, null if not present.
      • getRequestedTokenType

        public TokenTypeURI getRequestedTokenType()
        Returns the optional identifier for the requested type of security token.
        Returns:
        The requested token type, null if not specified.
      • getAudience

        public List<AudiencegetAudience()
        Returns the optional audience for the requested security token.
        Returns:
        The audience, null if not specified.
      • parse

        public static TokenExchangeGrant parse​(Map<String,​List<String>> params)
                                        throws ParseException
        Parses a token exchange grant from the specified request body parameters.

        Example:

         grant_type=urn:ietf:params:oauth:grant-type:token-exchange
         resource=https://backend.example.com/api
         subject_token=accVkjcJyb4BWCxGsndESCJQbdFMogUC5PbRDqceLTC
         subject_token_type=urn:ietf:params:oauth:token-type:access_token
         
        Parameters:
        params - The parameters.
        Returns:
        The token exchange grant.
        Throws:
        ParseException - If parsing failed.