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
FieldsModifier and TypeFieldDescriptionstatic final StringError code of an unacceptable target (RFC 8693, section 2.2.2), which the framework has no constant for.static final intOrder of the contributor: after the multi-factor (100) and identity provider (110) ones. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontribute(org.springframework.security.oauth2.server.authorization.token.OAuth2TokenContext context, Map<String, Object> claims) Adds claims to the token being issued.
-
Field Details
-
ORDER
public static final int ORDEROrder of the contributor: after the multi-factor (100) and identity provider (110) ones.- See Also:
-
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:JwtClaimsContributorAdds claims to the token being issued.- Specified by:
contributein interfaceJwtClaimsContributor- 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.
-