Class TokenExchangeAudienceContributor

java.lang.Object
com.irurueta.authserver.authorization.api.web.exchange.TokenExchangeAudienceContributor
All Implemented Interfaces:
JwtClaimsContributor

@Component @Order(120) public class TokenExchangeAudienceContributor extends Object implements JwtClaimsContributor
Honours the audience parameter of a token exchange request, which the framework parses but ignores. The audiences of an exchanged access token are those the exchanging client may have (its "settings.client.audiences" setting); when the request names audiences, only the ones among them are kept. An audience outside the list of the client is simply not granted, and when none of the requested ones is allowed the request is refused with "invalid_target" (RFC 8693, section 2.2.2), so a narrowed request never comes back with every audience of the client. Tokens of any other grant type are not touched.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Error code of an unacceptable target (RFC 8693, section 2.2.2), which the framework has no constant for.
    static final int
    Order of the contributor: after the multi-factor (100) and identity provider (110) ones.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    contribute(org.springframework.security.oauth2.server.authorization.token.OAuth2TokenContext context, Map<String,Object> claims)
    Adds claims to the token being issued.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ORDER

      public static final int ORDER
      Order of the contributor: after the multi-factor (100) and identity provider (110) ones.
      See Also:
    • INVALID_TARGET

      public static final String INVALID_TARGET
      Error code of an unacceptable target (RFC 8693, section 2.2.2), which the framework has no constant for.
      See Also:
  • Constructor Details

    • TokenExchangeAudienceContributor

      public TokenExchangeAudienceContributor()
  • Method Details

    • contribute

      public void contribute(org.springframework.security.oauth2.server.authorization.token.OAuth2TokenContext context, Map<String,Object> claims)
      Description copied from interface: JwtClaimsContributor
      Adds claims to the token being issued.
      Specified by:
      contribute in interface JwtClaimsContributor
      Parameters:
      context - the token context, with the token type, the principal, the client and the grant type.
      claims - the mutable claims of the token being built.