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 TypeMethodDescriptionbuild()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 uri) Sets the URI of the endpoint (HTTP or HTTPS) for which the request is intended.includeGrantedScopes(boolean includeGrantedScopes) Requests incremental authorisation.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.
-
Constructor Details
-
Builder
Creates a new authorisation request builder.- Parameters:
rt- The response type. Corresponds to theresponse_typeparameter. Must not benull.clientID- The client identifier. Corresponds to theclient_idparameter. 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_typeparameter.- Parameters:
rt- The response type. Must not benull.- Returns:
- This builder.
-
redirectionURI
Sets the redirection URI. Corresponds to the optionalredirection_uriparameter.- Parameters:
redirectURI- The redirection URI,nullif not specified.- Returns:
- This builder.
-
scope
Sets the scope. Corresponds to the optionalscopeparameter.- Parameters:
scope- The scope,nullif not specified.- Returns:
- This builder.
-
state
Sets the state. Corresponds to the recommendedstateparameter.- Parameters:
state- The state,nullif not specified.- Returns:
- This builder.
-
responseMode
Sets the response mode. Corresponds to the optionalresponse_modeparameter. Use of this parameter is not recommended unless a non-default response mode is requested (e.g. form_post).- Parameters:
rm- The response mode,nullif 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,nullif not specified.codeChallengeMethod- The code challenge method,nullif 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,nullif PKCE is not specified.codeChallengeMethod- The code challenge method,nullif not specified. Defaults toCodeChallengeMethod.PLAINif a code verifier is specified.- Returns:
- This builder.
-
resource
Sets the resource server URI.- Parameters:
resource- The resource URI,nullif not specified.- Returns:
- This builder.
-
resources
Sets the resource server URI(s).- Parameters:
resources- The resource URI(s),nullif not specified.- Returns:
- This builder.
-
includeGrantedScopes
Requests incremental authorisation.- Parameters:
includeGrantedScopes-trueto request incremental authorisation.- Returns:
- This builder.
-
requestObject
Sets the request object. Corresponds to the optionalrequestparameter. Must not be specified together with a request object URI.- Parameters:
requestObject- The request object,nullif not specified.- Returns:
- This builder.
-
requestURI
Sets the request object URI. Corresponds to the optionalrequest_uriparameter. Must not be specified together with a request object.- Parameters:
requestURI- The request object URI,nullif not specified.- Returns:
- This builder.
-
prompt
Sets the requested prompt. Corresponds to the optionalpromptparameter.- Parameters:
prompt- The requested prompt,nullif not specified.- Returns:
- This builder.
-
dPoPJWKThumbprintConfirmation
public AuthorizationRequest.Builder dPoPJWKThumbprintConfirmation(JWKThumbprintConfirmation dpopJKT) Sets the DPoP JWK SHA-256 thumbprint. Corresponds to the optionaldpop_jktparameter.- Parameters:
dpopJKT- DPoP JWK SHA-256 thumbprint,nullif not specified.- Returns:
- This builder.
-
customParameter
Sets a custom parameter.- Parameters:
name- The parameter name. Must not benull.values- The parameter values,nullif not specified.- Returns:
- This builder.
-
endpointURI
Sets the URI of the endpoint (HTTP or HTTPS) for which the request is intended.- Parameters:
uri- The endpoint URI,nullif not specified.- Returns:
- This builder.
-
build
Builds a new authorisation request.- Returns:
- The authorisation request.
-