Class DefaultAuthorizationCodeTokenResponseClient
java.lang.Object
com.codename1.backend.security.oauth2.client.DefaultAuthorizationCodeTokenResponseClient
- All Implemented Interfaces:
OAuth2AccessTokenResponseClient
public final class DefaultAuthorizationCodeTokenResponseClient
extends Object
implements OAuth2AccessTokenResponseClient
The exchange over the runtime's HTTP client, which parks the request's thread while the provider answers.
The client authenticates the way its registration says: the id and secret in
an Authorization: Basic header, as form fields, or -- a public client --
the id alone. The PKCE verifier goes with every exchange.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTokenResponse(ClientRegistration registration, OAuth2AuthorizationRequest authorizationRequest, String code) The provider's answer.static StringsanitizeErrorCode(String error) Theerrorparameter of a callback, reduced to an error code as RFC 6749 spells one: anything else a provider sent comes back asinvalid_request.
-
Constructor Details
-
DefaultAuthorizationCodeTokenResponseClient
public DefaultAuthorizationCodeTokenResponseClient()
-
-
Method Details
-
getTokenResponse
public OAuth2AccessTokenResponse getTokenResponse(ClientRegistration registration, OAuth2AuthorizationRequest authorizationRequest, String code) Description copied from interface:OAuth2AccessTokenResponseClientThe provider's answer.
OAuth2AuthenticationException: when the provider refuses, cannot be reached, or answers with something that is not a token response
- Specified by:
getTokenResponsein interfaceOAuth2AccessTokenResponseClient
-
sanitizeErrorCode
-