public static final class TokenRequest.Builder extends Object
TokenRequest
.Constructor and Description |
---|
Builder(AuthorizationServiceConfiguration configuration,
String clientId)
Creates a token request builder with the specified mandatory properties.
|
Modifier and Type | Method and Description |
---|---|
TokenRequest |
build()
Produces a
TokenRequest instance, if all necessary values have been provided. |
TokenRequest.Builder |
setAdditionalParameters(Map<String,String> additionalParameters)
Specifies an additional set of parameters to be sent as part of the request.
|
TokenRequest.Builder |
setAuthorizationCode(String authorizationCode)
Specifies the authorization code for the request.
|
TokenRequest.Builder |
setClientId(String clientId)
Specifies the client ID for the token request, which must not be null or empty.
|
TokenRequest.Builder |
setCodeVerifier(String codeVerifier)
Specifies the code verifier for an authorization code exchange request.
|
TokenRequest.Builder |
setConfiguration(AuthorizationServiceConfiguration configuration)
Specifies the authorization service configuration for the request, which must not
be null or empty.
|
TokenRequest.Builder |
setGrantType(String grantType)
Specifies the grant type for the request, which must not be null or empty.
|
TokenRequest.Builder |
setRedirectUri(Uri redirectUri)
Specifies the redirect URI for the request.
|
TokenRequest.Builder |
setRefreshToken(String refreshToken)
Specifies the refresh token for the request.
|
TokenRequest.Builder |
setScope(String scope)
Specifies the encoded scope string, which is a space-delimited set of
case-sensitive scope identifiers.
|
TokenRequest.Builder |
setScopes(Iterable<String> scopes)
Specifies the set of case-sensitive scopes.
|
TokenRequest.Builder |
setScopes(String... scopes)
Specifies the set of case-sensitive scopes.
|
public Builder(@NonNull AuthorizationServiceConfiguration configuration, @NonNull String clientId)
@NonNull public TokenRequest.Builder setConfiguration(@NonNull AuthorizationServiceConfiguration configuration)
@NonNull public TokenRequest.Builder setClientId(@NonNull String clientId)
@NonNull public TokenRequest.Builder setGrantType(@NonNull String grantType)
@NonNull public TokenRequest.Builder setRedirectUri(@Nullable Uri redirectUri)
@NonNull public TokenRequest.Builder setScope(@Nullable String scope)
@NonNull public TokenRequest.Builder setScopes(String... scopes)
Scopes specified here are used to obtain a "down-scoped" access token, where the set of scopes specified must be a subset of those already granted in previous requests.
@NonNull public TokenRequest.Builder setScopes(@Nullable Iterable<String> scopes)
Scopes specified here are used to obtain a "down-scoped" access token, where the set of scopes specified must be a subset of those already granted in previous requests.
@NonNull public TokenRequest.Builder setAuthorizationCode(@Nullable String authorizationCode)
Specifying an authorization code normally implies that this is a request to exchange this authorization code for one or more tokens. If this is not intended, the grant type should be explicitly set.
@NonNull public TokenRequest.Builder setRefreshToken(@Nullable String refreshToken)
Specifying a refresh token normally implies that this is a request to exchange the refresh token for a new token. If this is not intended, the grant type should be explicit set.
public TokenRequest.Builder setCodeVerifier(@Nullable String codeVerifier)
@NonNull public TokenRequest.Builder setAdditionalParameters(@Nullable Map<String,String> additionalParameters)
@NonNull public TokenRequest build()
TokenRequest
instance, if all necessary values have been provided.