public static final class AuthorizationRequest.Builder
extends java.lang.Object
Creates instances of AuthorizationRequest.
| Constructor and Description |
|---|
Builder(AuthorizationServiceConfiguration configuration,
java.lang.String clientId,
java.lang.String responseType,
android.net.Uri redirectUri)
Creates an authorization request builder with the specified mandatory properties.
|
| Modifier and Type | Method and Description |
|---|---|
AuthorizationRequest |
build()
Constructs the authorization request.
|
AuthorizationRequest.Builder |
setAdditionalParameters(java.util.Map<java.lang.String,java.lang.String> additionalParameters)
Specifies additional parameters.
|
AuthorizationRequest.Builder |
setAuthorizationServiceConfiguration(AuthorizationServiceConfiguration configuration)
Specifies the service configuration to be used in dispatching this request.
|
AuthorizationRequest.Builder |
setClientId(java.lang.String clientId)
Specifies the client ID.
|
AuthorizationRequest.Builder |
setCodeVerifier(java.lang.String codeVerifier)
Specifies the code verifier to use for this authorization request.
|
AuthorizationRequest.Builder |
setCodeVerifier(java.lang.String codeVerifier,
java.lang.String codeVerifierChallenge,
java.lang.String codeVerifierChallengeMethod)
Specifies the code verifier, challenge and method strings to use for this authorization
request.
|
AuthorizationRequest.Builder |
setDisplay(java.lang.String display)
Specifies the OpenID Connect 1.0
display parameter. |
AuthorizationRequest.Builder |
setLoginHint(java.lang.String loginHint)
Specifies the OpenID Connect 1.0
login_hint parameter. |
AuthorizationRequest.Builder |
setPrompt(java.lang.String prompt)
Specifies the encoded OpenID Connect 1.0
prompt parameter, which is a
space-delimited set of case sensitive ASCII prompt values. |
AuthorizationRequest.Builder |
setPromptValues(java.lang.Iterable<java.lang.String> promptValues)
Specifies the set of OpenID Connect 1.0
prompt parameter values, which are
space-delimited, case sensitive ASCII prompt values. |
AuthorizationRequest.Builder |
setPromptValues(java.lang.String... promptValues)
Specifies the set of OpenID Connect 1.0
prompt parameter values, which are
space-delimited, case sensitive ASCII prompt values. |
AuthorizationRequest.Builder |
setRedirectUri(android.net.Uri redirectUri)
Specifies the client’s redirect URI.
|
AuthorizationRequest.Builder |
setResponseMode(java.lang.String responseMode)
Specifies the response mode to be used for returning authorization response parameters
from the authorization endpoint.
|
AuthorizationRequest.Builder |
setResponseType(java.lang.String responseType)
Specifies the expected response type.
|
AuthorizationRequest.Builder |
setScope(java.lang.String scope)
Specifies the encoded scope string, which is a space-delimited set of
case-sensitive scope identifiers.
|
AuthorizationRequest.Builder |
setScopes(java.lang.Iterable<java.lang.String> scopes)
Specifies the set of case-sensitive scopes.
|
AuthorizationRequest.Builder |
setScopes(java.lang.String... scopes)
Specifies the set of case-sensitive scopes.
|
AuthorizationRequest.Builder |
setState(java.lang.String state)
Specifies the opaque value used by the client to maintain state between the request and
callback.
|
public Builder(@NonNull
AuthorizationServiceConfiguration configuration,
@NonNull
java.lang.String clientId,
@NonNull
java.lang.String responseType,
@NonNull
android.net.Uri redirectUri)
Creates an authorization request builder with the specified mandatory properties.
public AuthorizationRequest.Builder setAuthorizationServiceConfiguration(@NonNull AuthorizationServiceConfiguration configuration)
Specifies the service configuration to be used in dispatching this request.
@NonNull public AuthorizationRequest.Builder setClientId(@NonNull java.lang.String clientId)
Specifies the client ID. Cannot be null or empty.
public AuthorizationRequest.Builder setDisplay(@Nullable java.lang.String display)
Specifies the OpenID Connect 1.0 display parameter.
public AuthorizationRequest.Builder setLoginHint(@Nullable java.lang.String loginHint)
Specifies the OpenID Connect 1.0 login_hint parameter.
@NonNull public AuthorizationRequest.Builder setPrompt(@Nullable java.lang.String prompt)
Specifies the encoded OpenID Connect 1.0 prompt parameter, which is a
space-delimited set of case sensitive ASCII prompt values. Replaces any previously
specified prompt values.
@NonNull public AuthorizationRequest.Builder setPromptValues(@Nullable java.lang.String... promptValues)
Specifies the set of OpenID Connect 1.0 prompt parameter values, which are
space-delimited, case sensitive ASCII prompt values. Replaces any previously
specified prompt values.
@NonNull public AuthorizationRequest.Builder setPromptValues(@Nullable java.lang.Iterable<java.lang.String> promptValues)
Specifies the set of OpenID Connect 1.0 prompt parameter values, which are
space-delimited, case sensitive ASCII prompt values. Replaces any previously
specified prompt values.
@NonNull public AuthorizationRequest.Builder setResponseType(@NonNull java.lang.String responseType)
Specifies the expected response type. Cannot be null or empty.
@NonNull public AuthorizationRequest.Builder setRedirectUri(@NonNull android.net.Uri redirectUri)
Specifies the client’s redirect URI. Cannot be null or empty.
@NonNull public AuthorizationRequest.Builder setScope(@Nullable java.lang.String scope)
Specifies the encoded scope string, which is a space-delimited set of case-sensitive scope identifiers. Replaces any previously specified scope.
@NonNull public AuthorizationRequest.Builder setScopes(java.lang.String... scopes)
Specifies the set of case-sensitive scopes. Replaces any previously specified set of
scopes. If no arguments are provided, the scope string will be set to null.
Individual scope strings cannot be null or empty.
@NonNull public AuthorizationRequest.Builder setScopes(@Nullable java.lang.Iterable<java.lang.String> scopes)
Specifies the set of case-sensitive scopes. Replaces any previously specified set of
scopes. If the iterable is empty, the scope string will be set to null.
Individual scope strings cannot be null or empty.
@NonNull public AuthorizationRequest.Builder setState(@Nullable java.lang.String state)
Specifies the opaque value used by the client to maintain state between the request and callback. If this value is not explicitly set, this library will automatically add state and perform appropriate validation of the state in the authorization response. It is recommended that the default implementation of this parameter be used wherever possible. Typically used to prevent CSRF attacks, as recommended in RFC6819 Section 5.3.5.
@NonNull public AuthorizationRequest.Builder setCodeVerifier(@Nullable java.lang.String codeVerifier)
Specifies the code verifier to use for this authorization request. The default challenge
method (typically AuthorizationRequest.CODE_CHALLENGE_METHOD_S256) implemented by
CodeVerifierUtil will be used, and a challenge will be generated using this
method. If the use of a code verifier is not desired, set the code verifier
to null.
@NonNull public AuthorizationRequest.Builder setCodeVerifier(@Nullable java.lang.String codeVerifier, @Nullable java.lang.String codeVerifierChallenge, @Nullable java.lang.String codeVerifierChallengeMethod)
Specifies the code verifier, challenge and method strings to use for this authorization request. If these values are not explicitly set, they will be automatically generated and used. It is recommended that this default behavior be used wherever possible. If a null code verifier is set (to indicate that a code verifier is not to be used), then the challenge and method must also be null. If a non-null code verifier is set, the code verifier challenge and method must also be set.
@NonNull public AuthorizationRequest.Builder setResponseMode(@Nullable java.lang.String responseMode)
Specifies the response mode to be used for returning authorization response parameters from the authorization endpoint.
@NonNull public AuthorizationRequest.Builder setAdditionalParameters(@Nullable java.util.Map<java.lang.String,java.lang.String> additionalParameters)
Specifies additional parameters. Replaces any previously provided set of parameters. Parameter keys and values cannot be null or empty.
@NonNull public AuthorizationRequest build()
Constructs the authorization request. At a minimum the following fields must have been set:
Failure to specify any of these parameters will result in a runtime exception.