Package com.nimbusds.oauth2.sdk
Class AuthorizationRequest.Builder
java.lang.Object
com.nimbusds.oauth2.sdk.AuthorizationRequest.Builder
- Enclosing class:
- AuthorizationRequest
Builder for constructing authorisation requests.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new JWT secured authorisation request (JAR) builder.Builder
(AuthorizationRequest request) Creates a new authorisation request builder from the specified request.Builder
(ResponseType rt, ClientID clientID) Creates a new authorisation request builder.Creates a new JWT secured authorisation request (JAR) builder. -
Method Summary
Modifier and TypeMethodDescriptionauthorizationDetails
(List<AuthorizationDetail> authorizationDetails) Sets the Rich Authorisation Request (RAR) details.build()
Builds a new authorisation request.codeChallenge
(CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod) Deprecated.codeChallenge
(CodeVerifier codeVerifier, CodeChallengeMethod codeChallengeMethod) Sets the code challenge for Proof Key for Code Exchange (PKCE) by public OAuth clients.customParameter
(String name, String... values) Sets a custom parameter.Sets the DPoP JWK SHA-256 thumbprint.endpointURI
(URI endpoint) Sets the URI of the authorisation endpoint.includeGrantedScopes
(boolean includeGrantedScopes) Requests incremental authorisation.Sets the requested prompt.prompt
(Prompt.Type... promptType) Sets the requested prompt.redirectionURI
(URI redirectURI) Sets the redirection URI.requestObject
(com.nimbusds.jwt.JWT requestObject) Sets the request object.requestURI
(URI requestURI) Sets the request object URI.Sets the resource server URI.Sets the resource server URI(s).Sets the response mode.Sets the response type.Sets the scope.Sets the state.trustChain
(TrustChain trustChain) Sets the OpenID Connect Federation 1.0 trust chain.
-
Constructor Details
-
Builder
Creates a new authorisation request builder.- Parameters:
rt
- The response type. Corresponds to theresponse_type
parameter. Must not benull
.clientID
- The client identifier. Corresponds to theclient_id
parameter. Must not benull
.
-
Builder
Creates a new JWT secured authorisation request (JAR) builder.- Parameters:
requestObject
- The request object. Must not benull
.clientID
- The client ID. Must not benull
.
-
Builder
Creates a new JWT secured authorisation request (JAR) builder.- Parameters:
requestURI
- The request object URI. Must not benull
.clientID
- The client ID. Must not benull
.
-
Builder
Creates a new authorisation request builder from the specified request.- Parameters:
request
- The authorisation request. Must not benull
.
-
-
Method Details
-
responseType
Sets the response type. Corresponds to theresponse_type
parameter.- Parameters:
rt
- The response type. Must not benull
.- Returns:
- This builder.
-
redirectionURI
Sets the redirection URI. Corresponds to the optionalredirection_uri
parameter.- Parameters:
redirectURI
- The redirection URI,null
if not specified.- Returns:
- This builder.
-
scope
Sets the scope. Corresponds to the optionalscope
parameter.- Parameters:
scope
- The scope,null
if not specified.- Returns:
- This builder.
-
state
Sets the state. Corresponds to the recommendedstate
parameter.- Parameters:
state
- The state,null
if not specified.- Returns:
- This builder.
-
responseMode
Sets the response mode. Corresponds to the optionalresponse_mode
parameter. Use of this parameter is not recommended unless a non-default response mode is requested (e.g. form_post).- Parameters:
rm
- The response mode,null
if not specified.- Returns:
- This builder.
-
codeChallenge
@Deprecated public AuthorizationRequest.Builder codeChallenge(CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod) Deprecated.Sets the code challenge for Proof Key for Code Exchange (PKCE) by public OAuth clients.- Parameters:
codeChallenge
- The code challenge,null
if not specified.codeChallengeMethod
- The code challenge method,null
if not specified.- Returns:
- This builder.
-
codeChallenge
public AuthorizationRequest.Builder codeChallenge(CodeVerifier codeVerifier, CodeChallengeMethod codeChallengeMethod) Sets the code challenge for Proof Key for Code Exchange (PKCE) by public OAuth clients.- Parameters:
codeVerifier
- The code verifier to use to compute the code challenge,null
if PKCE is not specified.codeChallengeMethod
- The code challenge method,null
if not specified. Defaults toCodeChallengeMethod.PLAIN
if a code verifier is specified.- Returns:
- This builder.
-
authorizationDetails
public AuthorizationRequest.Builder authorizationDetails(List<AuthorizationDetail> authorizationDetails) Sets the Rich Authorisation Request (RAR) details.- Parameters:
authorizationDetails
- The authorisation details,null
if not specified.- Returns:
- This builder.
-
resource
Sets the resource server URI.- Parameters:
resource
- The resource URI,null
if not specified.- Returns:
- This builder.
-
resources
Sets the resource server URI(s).- Parameters:
resources
- The resource URI(s),null
if not specified.- Returns:
- This builder.
-
includeGrantedScopes
Requests incremental authorisation.- Parameters:
includeGrantedScopes
-true
to request incremental authorisation.- Returns:
- This builder.
-
requestObject
Sets the request object. Corresponds to the optionalrequest
parameter. Must not be specified together with a request object URI.- Parameters:
requestObject
- The request object,null
if not specified.- Returns:
- This builder.
-
requestURI
Sets the request object URI. Corresponds to the optionalrequest_uri
parameter. Must not be specified together with a request object.- Parameters:
requestURI
- The request object URI,null
if not specified.- Returns:
- This builder.
-
prompt
Sets the requested prompt. Corresponds to the optionalprompt
parameter.- Parameters:
prompt
- The requested prompt,null
if not specified.- Returns:
- This builder.
-
prompt
Sets the requested prompt. Corresponds to the optionalprompt
parameter.- Parameters:
promptType
- The requested prompt types,null
if not specified.- Returns:
- This builder.
-
dPoPJWKThumbprintConfirmation
public AuthorizationRequest.Builder dPoPJWKThumbprintConfirmation(JWKThumbprintConfirmation dpopJKT) Sets the DPoP JWK SHA-256 thumbprint. Corresponds to the optionaldpop_jkt
parameter.- Parameters:
dpopJKT
- DPoP JWK SHA-256 thumbprint,null
if not specified.- Returns:
- This builder.
-
trustChain
Sets the OpenID Connect Federation 1.0 trust chain. Corresponds to the optionaltrust_chain
parameter.- Parameters:
trustChain
- The trust chain,null
if not specified.- Returns:
- This builder.
-
customParameter
Sets a custom parameter.- Parameters:
name
- The parameter name. Must not benull
.values
- The parameter values,null
if not specified.- Returns:
- This builder.
-
endpointURI
Sets the URI of the authorisation endpoint.- Parameters:
endpoint
- The URI of the authorisation endpoint. May benull
if the request is not going to be serialised.- Returns:
- This builder.
-
build
Builds a new authorisation request.- Returns:
- The authorisation request.
-