Interface OAuthAccessTokenAudienceProvider
- All Known Implementing Classes:
OAuthAccessTokenAudienceTokenRequestProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Contributes the
aud claim of the access tokens the authorization
server issues. Providers are consulted in ascending getOrder(); the
first non-empty answer becomes the claim.-
Method Summary
Modifier and TypeMethodDescriptiondefault intgetOrder()provideAudiences(org.springframework.security.oauth2.server.authorization.token.OAuth2TokenContext context)
-
Method Details
-
provideAudiences
List<String> provideAudiences(org.springframework.security.oauth2.server.authorization.token.OAuth2TokenContext context) - Parameters:
context- the access token being issued- Returns:
- the audiences of the token, or null or empty to let another provider answer
- Throws:
org.springframework.security.oauth2.core.OAuth2AuthenticationException- to refuse the token outright. Every provider is consulted for every token, so a refusal holds whatever the provider's order and whether or not another provider has already answered.
-
getOrder
default int getOrder()- Returns:
- this provider's position, lower values consulted first — the
Spring
Orderedconvention. It decides which answer becomes the claim, never whether a refusal is heard.
-