Interface TokenExchangeConfig
STILL IN BETA. API MAY CHANGE.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final TokenExchangeConfigstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenExchangeConfig.Builderbuilder()static TokenExchangeConfigfromConfigSupplier(Function<String, String> config) default BiFunction<AccessToken,RefreshToken, TypedToken> The actor token provider.The logical name of the target service where the client intends to use the requested security token.An alternate client ID to use for token exchanges only.An alternate client secret to use for token exchanges only.The root URL of an alternate OpenID Connect identity issuer provider, which will be used for discovering supported endpoints and their locations, for token exchange only.default URIThe type of the requested security token.A URI that indicates the target service or resource where the client intends to use the requested security token.The OAuth2 scopes.default BiFunction<AccessToken,RefreshToken, TypedToken> The subject token provider.An alternate OAuth2 token endpoint, for token exchange only.default booleanWhether token exchange is enabled.
-
Field Details
-
SCOPES_INHERIT
-
DISABLED
-
CURRENT_ACCESS_TOKEN
- See Also:
-
CURRENT_REFRESH_TOKEN
- See Also:
-
NO_TOKEN
- See Also:
-
-
Method Details
-
fromConfigSupplier
-
isEnabled
@Default default boolean isEnabled()Whether token exchange is enabled. If enabled, the access token obtained from the OAuth2 server will be exchanged for a new token, using the token endpoint and the token exchange grant type, as defined in RFC 8693. -
getClientId
An alternate client ID to use for token exchanges only. If not provided, the global client ID will be used. If provided, and if the client is confidential, then its secret must be provided withgetClientSecret()– the global client secret will NOT be used. -
getClientSecret
An alternate client secret to use for token exchanges only. Required if the alternate client obtained fromgetClientId()is confidential. -
getIssuerUrl
The root URL of an alternate OpenID Connect identity issuer provider, which will be used for discovering supported endpoints and their locations, for token exchange only.If neither this property nor
getTokenEndpoint()are defined, the global token endpoint will be used. This means that the same authorization server will be used for both the initial token request and the token exchange.Endpoint discovery is performed using the OpenID Connect Discovery metadata published by the issuer. See OpenID Connect Discovery 1.0 for more information.
-
getTokenEndpoint
An alternate OAuth2 token endpoint, for token exchange only.If neither this property nor
getIssuerUrl()are defined, the global token endpoint will be used. This means that the same authorization server will be used for both the initial token request and the token exchange. -
getRequestedTokenType
The type of the requested security token. By default,TypedToken.URN_ACCESS_TOKEN.Currently, it is not possible to request any other token type, so this property is not configurable through system properties.
-
getResource
A URI that indicates the target service or resource where the client intends to use the requested security token. -
getAudience
The logical name of the target service where the client intends to use the requested security token. This serves a purpose similar to the resource parameter but with the client providing a logical name for the target service. -
getScopes
The OAuth2 scopes. Optional.The special value
SCOPES_INHERIT(default) means that the scopes will be inherited from the global OAuth2 configuration. -
getSubjectTokenProvider
@Default @Auxiliary default BiFunction<AccessToken,RefreshToken, getSubjectTokenProvider()TypedToken> The subject token provider. The provider will be invoked with the current access token (never null) and the current refresh token, or null if none available; and should return aTypedTokenrepresenting the subject token. It must NOT return null.By default, the provider will return the access token itself. This should be suitable for most cases.
This property cannot be set through configuration, but only programmatically. The configuration exposes two options: the subject token and its type. These options allow to pass a static subject token only.
-
getActorTokenProvider
The actor token provider. The provider will be invoked with the current access token (never null) and the current refresh token, or null if none available; and should return aTypedTokenrepresenting the actor token. If the provider returns null, then no actor token will be used.Actor tokens are useful in delegation scenarios. By default, no actor token is used.
This property cannot be set through configuration, but only programmatically. The configuration exposes two options: the actor token and its type. These options allow to pass a static actor token only.
-
builder
-