Class OauthCodeTokenRequestContext
java.lang.Object
io.micronaut.security.oauth2.endpoint.token.request.context.AbstractTokenRequestContext<Map<String,String>, TokenResponse>
io.micronaut.security.oauth2.endpoint.token.request.context.OauthCodeTokenRequestContext
- All Implemented Interfaces:
TokenRequestContext<Map<String,String>, TokenResponse>
public class OauthCodeTokenRequestContext
extends AbstractTokenRequestContext<Map<String,String>, TokenResponse>
A token request context for sending an authorization
code grant request to an OAuth 2.0 provider.
The redirect_uri parameter of the token request is built from the application's own
callback route via OauthRouteUrlBuilder, never from the state parameter received
in the authorization response, which is controlled by the party redirecting the browser to the
callback (see RFC 6749 sections 4.1.3 and 10.6).
- Since:
- 1.2.0
- Author:
- James Kleeh
-
Field Summary
Fields inherited from class AbstractTokenRequestContext
clientConfiguration, mediaType, tokenEndpoint -
Constructor Summary
ConstructorsConstructorDescriptionOauthCodeTokenRequestContext(AuthorizationResponse authorizationResponse, SecureEndpoint tokenEndpoint, OauthClientConfiguration clientConfiguration, @Nullable String codeVerifier) Deprecated, for removal: This API element is subject to removal in a future version.OauthCodeTokenRequestContext(AuthorizationResponse authorizationResponse, @Nullable OauthRouteUrlBuilder oauthRouteUrlBuilder, SecureEndpoint tokenEndpoint, OauthClientConfiguration clientConfiguration, @Nullable String codeVerifier) -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringio.micronaut.core.type.Argument<?> getGrant()io.micronaut.core.type.Argument<TokenResponse> Methods inherited from class AbstractTokenRequestContext
getClientConfiguration, getEndpoint, getMediaType
-
Constructor Details
-
OauthCodeTokenRequestContext
@Deprecated(forRemoval=true, since="5.5.2") public OauthCodeTokenRequestContext(AuthorizationResponse authorizationResponse, SecureEndpoint tokenEndpoint, OauthClientConfiguration clientConfiguration, @Nullable String codeVerifier) Deprecated, for removal: This API element is subject to removal in a future version.UseOauthCodeTokenRequestContext(AuthorizationResponse, OauthRouteUrlBuilder, SecureEndpoint, OauthClientConfiguration, String). A context created with this constructor does not send theredirect_uriparameter to the token endpoint.- Parameters:
authorizationResponse- The authorization responsetokenEndpoint- The token endpointclientConfiguration- The client configurationcodeVerifier- The PKCE code_verifier
-
OauthCodeTokenRequestContext
public OauthCodeTokenRequestContext(AuthorizationResponse authorizationResponse, @Nullable OauthRouteUrlBuilder oauthRouteUrlBuilder, SecureEndpoint tokenEndpoint, OauthClientConfiguration clientConfiguration, @Nullable String codeVerifier) - Parameters:
authorizationResponse- The authorization responseoauthRouteUrlBuilder- The OAuth 2.0 route URL builder used to build theredirect_uritokenEndpoint- The token endpointclientConfiguration- The client configurationcodeVerifier- The PKCE code_verifier- Since:
- 5.5.2
-
-
Method Details
-
getGrant
-
getResponseType
- Returns:
- The response argument
-
getErrorResponseType
public io.micronaut.core.type.Argument<?> getErrorResponseType()- Returns:
- The error response argument
-
getCodeVerifier
- Returns:
- The PKCE code verifier
- Since:
- 3.9.0
-
OauthCodeTokenRequestContext(AuthorizationResponse, OauthRouteUrlBuilder, SecureEndpoint, OauthClientConfiguration, String).