public class AuthorizationRequest extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AuthorizationRequest.Builder
Creates instances of
AuthorizationRequest . |
Modifier and Type | Field and Description |
---|---|
Map<String,String> |
additionalParameters
Additional parameters to be passed as part of the request.
|
String |
clientId
The client identifier.
|
static String |
CODE_CHALLENGE_METHOD_PLAIN
Plain-text code verifier challenge method.
|
static String |
CODE_CHALLENGE_METHOD_S256
SHA-256 based code verifier challenge method.
|
String |
codeVerifier
The proof key for code exchange.
|
String |
codeVerifierChallenge
The challenge derived from the
code verifier , using the
challenge method . |
String |
codeVerifierChallengeMethod
The challenge method used to generate a
challenge from
the code verifier . |
AuthorizationServiceConfiguration |
configuration
The service's
configuration . |
Uri |
redirectUri
The client's redirect URI.
|
static String |
RESPONSE_MODE_FRAGMENT
Instructs the authorization server to send response parameters using
the fragment portion of the redirect URI.
|
static String |
RESPONSE_MODE_QUERY
Instructs the authorization server to send response parameters using
the query portion of the redirect URI.
|
static String |
RESPONSE_TYPE_CODE
For requesting an authorization code.
|
static String |
RESPONSE_TYPE_TOKEN
For requesting an access token via an implicit grant.
|
String |
responseMode
Instructs the authorization service on the mechanism to be used for returning
response parameters from the authorization endpoint.
|
String |
responseType
The expected response type.
|
String |
scope
The optional set of scopes expressed as a space-delimited, case-sensitive string.
|
static String |
SCOPE_ADDRESS
A scope for the authenticated user's mailing address.
|
static String |
SCOPE_EMAIL
A scope for the authenticated user's email address.
|
static String |
SCOPE_OPENID
A scope for OpenID based authorization.
|
static String |
SCOPE_PHONE
A scope for the authenticated user's phone number.
|
static String |
SCOPE_PROFILE
A scope for the authenticated user's basic profile information.
|
String |
state
An opaque value used by the client to maintain state between the request and callback.
|
Modifier and Type | Method and Description |
---|---|
static AuthorizationRequest |
fromJson(JSONObject json)
Reads an Authorization request from a JSON representation produced by
toJson() . |
static AuthorizationRequest |
fromJson(String jsonStr)
Reads an Authorization request from a JSON string representation produced by
toJsonString() . |
Set<String> |
getScopeSet()
Derives the set of scopes from the consolidated, space-delimited scopes in the
scope field. |
JSONObject |
toJson()
Produces a JSON representation of the request for storage or transmission.
|
String |
toJsonString()
Produces a JSON string representation of the request for storage or transmission.
|
public static final String RESPONSE_MODE_QUERY
public static final String RESPONSE_MODE_FRAGMENT
public static final String RESPONSE_TYPE_CODE
public static final String RESPONSE_TYPE_TOKEN
public static final String SCOPE_OPENID
public static final String SCOPE_PROFILE
public static final String SCOPE_EMAIL
public static final String SCOPE_ADDRESS
public static final String SCOPE_PHONE
public static final String CODE_CHALLENGE_METHOD_S256
public static final String CODE_CHALLENGE_METHOD_PLAIN
@NonNull public final AuthorizationServiceConfiguration configuration
configuration
.
This configuration specifies how to connect to a particular OAuth provider.
Configurations may be
AuthorizationServiceConfiguration.AuthorizationServiceConfiguration(Uri, Uri)
created manually}, or AuthorizationServiceConfiguration.fetchFromUrl(Uri,
AuthorizationServiceConfiguration.RetrieveConfigurationCallback)
via an OpenID Connect
Discovery Document}.@Nullable public final String scope
@Nullable public final String state
@Nullable public final String codeVerifier
null
.@Nullable public final String codeVerifierChallenge
code verifier
, using the
challenge method
. If a code verifier is not being
used for this request, this value will be null
.@Nullable public final String codeVerifierChallengeMethod
challenge
from
the code verifier
. If a code verifier is not being used for this
request, this value will be null
.@Nullable public final String responseMode
@Nullable public Set<String> getScopeSet()
scope
field. If no scopes were specified for this request, the method will
return null
.@NonNull public JSONObject toJson()
public String toJsonString()
@NonNull public static AuthorizationRequest fromJson(@NonNull String jsonStr) throws JSONException
toJsonString()
.JSONException
- if the provided JSON does not match the expected structure.@NonNull public static AuthorizationRequest fromJson(@NonNull JSONObject json) throws JSONException
toJson()
.JSONException
- if the provided JSON does not match the expected structure.