Package com.nimbusds.openid.connect.sdk
Class AuthenticationRequest
java.lang.Object
com.nimbusds.oauth2.sdk.AbstractRequest
com.nimbusds.oauth2.sdk.AuthorizationRequest
com.nimbusds.openid.connect.sdk.AuthenticationRequest
OpenID Connect authentication request. Intended to authenticate an end-user
and request the end-user's authorisation to release information to the
client. Supports custom request parameters.
Example HTTP request (code flow):
https://server.example.com/op/authorize? response_type=code%20id_token &client_id=s6BhdRkqt3 &redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb &scope=openid &nonce=n-0S6_WzA2Mj &state=af0ifjsldkj
Related specifications:
- OpenID Connect Core 1.0
- Proof Key for Code Exchange by OAuth Public Clients (RFC 7636)
- OAuth 2.0 Rich Authorization Requests (RFC 9396)
- Resource Indicators for OAuth 2.0 (RFC 8707)
- OAuth 2.0 Incremental Authorization (draft-ietf-oauth-incremental-authz)
- The OAuth 2.0 Authorization Framework: JWT Secured Authorization Request (JAR) (RFC 9101)
- Financial-grade API: JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)
- OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP) (RFC 9449)
- OpenID Connect Federation 1.0
- OpenID Connect for Identity Assurance 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder for constructing OpenID Connect authentication requests. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The purpose string parameter maximum length.static final int
The purpose string parameter minimal length.Fields inherited from class com.nimbusds.oauth2.sdk.AuthorizationRequest
prompt
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationRequest
(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, ClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.AuthenticationRequest
(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.AuthenticationRequest
(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, JWKThumbprintConfirmation dpopJKT, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.AuthenticationRequest
(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, JWKThumbprintConfirmation dpopJKT, TrustChain trustChain, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<AuthorizationDetail> authorizationDetails, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Creates a new OpenID Connect authentication request with extension and custom parameters.AuthenticationRequest
(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, JWKThumbprintConfirmation dpopJKT, TrustChain trustChain, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.AuthenticationRequest
(URI endpoint, ResponseType rt, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce) Creates a new minimal OpenID Connect authentication request. -
Method Summary
Modifier and TypeMethodDescriptionReturns the requested Authentication Context Class Reference values.Deprecated.List<com.nimbusds.langtag.LangTag>
Returns the end-user's preferred languages and scripts for the claims being returned, ordered by preference.Returns the requested display type.com.nimbusds.jwt.JWT
Returns the ID Token hint.Returns the login hint.int
Returns the required maximum authentication age.getNonce()
Returns the nonce.Returns the individual OpenID claims to be returned.Returns the transaction specific purpose.Returns the registered (standard) OpenID Connect authentication request parameter names.List<com.nimbusds.langtag.LangTag>
Returns the end-user's preferred languages and scripts for the user interface, ordered by preference.static AuthenticationRequest
parse
(HTTPRequest httpRequest) Parses an authentication request from the specified HTTP GET or POST request.static AuthenticationRequest
Parses an OpenID Connect authentication request from the specified URI query string.static AuthenticationRequest
Parses an OpenID Connect authentication request from the specified URI.static AuthenticationRequest
Parses an OpenID Connect authentication request from the specified URI query string.static AuthenticationRequest
Parses an OpenID Connect authentication request from the specified URI and query parameters.static AuthenticationRequest
Parses an OpenID Connect authentication request from the specified URI query parameters.com.nimbusds.jwt.JWTClaimsSet
Returns the parameters for this authorisation request as a JSON Web Token (JWT) claims set.Returns the URI query parameters for this authorisation request.Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationRequest
getAuthorizationDetails, getClientID, getCodeChallenge, getCodeChallengeMethod, getCustomParameter, getCustomParameters, getDPoPJWKThumbprintConfirmation, getPrompt, getRedirectionURI, getRequestObject, getRequestURI, getResources, getResponseMode, getResponseType, getScope, getState, getTrustChain, impliedResponseMode, includeGrantedScopes, specifiesRequestObject, toHTTPRequest, toHTTPRequest, toQueryString, toURI
Methods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest
getEndpointURI
-
Field Details
-
PURPOSE_MIN_LENGTH
The purpose string parameter minimal length.- See Also:
-
PURPOSE_MAX_LENGTH
The purpose string parameter maximum length.- See Also:
-
-
Constructor Details
-
AuthenticationRequest
public AuthenticationRequest(URI endpoint, ResponseType rt, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce) Creates a new minimal OpenID Connect authentication request.- Parameters:
endpoint
- The URI of the authorisation endpoint. May benull
if the request is not going to be serialised.rt
- The response type. Corresponds to theresponse_type
parameter. Must specify a valid OpenID Connect response type. Must not benull
.scope
- The request scope. Corresponds to thescope
parameter. Must contain anopenid value
. Must not benull
.clientID
- The client identifier. Corresponds to theclient_id
parameter. Must not benull
.redirectURI
- The redirection URI. Corresponds to theredirect_uri
parameter. Must not benull
.state
- The state. Corresponds to thestate
parameter. May benull
.nonce
- The nonce. Corresponds to thenonce
parameter. May benull
for code flow.
-
AuthenticationRequest
@Deprecated public AuthenticationRequest(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, ClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.Creates a new OpenID Connect authentication request with extension and custom parameters.- Parameters:
endpoint
- The URI of the authorisation endpoint. May benull
if the request is not going to be serialised.rt
- The response type set. Corresponds to theresponse_type
parameter. Must specify a valid OpenID Connect response type. Must not benull
.rm
- 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).scope
- The request scope. Corresponds to thescope
parameter. Must contain anopenid value
. Must not benull
.clientID
- The client identifier. Corresponds to theclient_id
parameter. Must not benull
.redirectURI
- The redirection URI. Corresponds to theredirect_uri
parameter. Must not benull
unless set by means of the optionalrequest_object
/request_uri
parameter.state
- The state. Corresponds to the recommendedstate
parameter.null
if not specified.nonce
- The nonce. Corresponds to thenonce
parameter. May benull
for code flow.display
- The requested display type. Corresponds to the optionaldisplay
parameter.null
if not specified.prompt
- The requested prompt. Corresponds to the optionalprompt
parameter.null
if not specified.maxAge
- The required maximum authentication age, in seconds. Corresponds to the optionalmax_age
parameter. -1 if not specified, zero impliesprompt=login
.uiLocales
- The preferred languages and scripts for the user interface. Corresponds to the optionalui_locales
parameter.null
if not specified.claimsLocales
- The preferred languages and scripts for claims being returned. Corresponds to the optionalclaims_locales
parameter.null
if not specified.idTokenHint
- The ID Token hint. Corresponds to the optionalid_token_hint
parameter.null
if not specified.loginHint
- The login hint. Corresponds to the optionallogin_hint
parameter.null
if not specified.acrValues
- The requested Authentication Context Class Reference values. Corresponds to the optionalacr_values
parameter.null
if not specified.claims
- The individual claims to be returned. Corresponds to the optionalclaims
parameter.null
if not specified.purpose
- The transaction specific purpose,null
if not specified.requestObject
- The request object. Corresponds to the optionalrequest
parameter. Must not be specified together with a request object URI.null
if not specified.requestURI
- The request object URI. Corresponds to the optionalrequest_uri
parameter. Must not be specified together with a request object.null
if not specified.codeChallenge
- The code challenge for PKCE,null
if not specified.codeChallengeMethod
- The code challenge method for PKCE,null
if not specified.resources
- The resource URI(s),null
if not specified.includeGrantedScopes
-true
to request incremental authorisation.customParams
- Additional custom parameters, empty map ornull
if none.
-
AuthenticationRequest
@Deprecated public AuthenticationRequest(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.Creates a new OpenID Connect authentication request with extension and custom parameters.- Parameters:
endpoint
- The URI of the authorisation endpoint. May benull
if the request is not going to be serialised.rt
- The response type set. Corresponds to theresponse_type
parameter. Must specify a valid OpenID Connect response type. Must not benull
.rm
- 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).scope
- The request scope. Corresponds to thescope
parameter. Must contain anopenid value
. Must not benull
.clientID
- The client identifier. Corresponds to theclient_id
parameter. Must not benull
.redirectURI
- The redirection URI. Corresponds to theredirect_uri
parameter. Must not benull
unless set by means of the optionalrequest_object
/request_uri
parameter.state
- The state. Corresponds to the recommendedstate
parameter.null
if not specified.nonce
- The nonce. Corresponds to thenonce
parameter. May benull
for code flow.display
- The requested display type. Corresponds to the optionaldisplay
parameter.null
if not specified.prompt
- The requested prompt. Corresponds to the optionalprompt
parameter.null
if not specified.maxAge
- The required maximum authentication age, in seconds. Corresponds to the optionalmax_age
parameter. -1 if not specified, zero impliesprompt=login
.uiLocales
- The preferred languages and scripts for the user interface. Corresponds to the optionalui_locales
parameter.null
if not specified.claimsLocales
- The preferred languages and scripts for claims being returned. Corresponds to the optionalclaims_locales
parameter.null
if not specified.idTokenHint
- The ID Token hint. Corresponds to the optionalid_token_hint
parameter.null
if not specified.loginHint
- The login hint. Corresponds to the optionallogin_hint
parameter.null
if not specified.acrValues
- The requested Authentication Context Class Reference values. Corresponds to the optionalacr_values
parameter.null
if not specified.claims
- The individual OpenID claims to be returned. Corresponds to the optionalclaims
parameter.null
if not specified.purpose
- The transaction specific purpose,null
if not specified.requestObject
- The request object. Corresponds to the optionalrequest
parameter. Must not be specified together with a request object URI.null
if not specified.requestURI
- The request object URI. Corresponds to the optionalrequest_uri
parameter. Must not be specified together with a request object.null
if not specified.codeChallenge
- The code challenge for PKCE,null
if not specified.codeChallengeMethod
- The code challenge method for PKCE,null
if not specified.resources
- The resource URI(s),null
if not specified.includeGrantedScopes
-true
to request incremental authorisation.customParams
- Additional custom parameters, empty map ornull
if none.
-
AuthenticationRequest
@Deprecated public AuthenticationRequest(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, JWKThumbprintConfirmation dpopJKT, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.Creates a new OpenID Connect authentication request with extension and custom parameters.- Parameters:
endpoint
- The URI of the authorisation endpoint. May benull
if the request is not going to be serialised.rt
- The response type set. Corresponds to theresponse_type
parameter. Must specify a valid OpenID Connect response type. Must not benull
.rm
- 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).scope
- The request scope. Corresponds to thescope
parameter. Must contain anopenid value
. Must not benull
.clientID
- The client identifier. Corresponds to theclient_id
parameter. Must not benull
.redirectURI
- The redirection URI. Corresponds to theredirect_uri
parameter. Must not benull
unless set by means of the optionalrequest_object
/request_uri
parameter.state
- The state. Corresponds to the recommendedstate
parameter.null
if not specified.nonce
- The nonce. Corresponds to thenonce
parameter. May benull
for code flow.display
- The requested display type. Corresponds to the optionaldisplay
parameter.null
if not specified.prompt
- The requested prompt. Corresponds to the optionalprompt
parameter.null
if not specified.dpopJKT
- The DPoP JWK SHA-256 thumbprint,null
if not specified.maxAge
- The required maximum authentication age, in seconds. Corresponds to the optionalmax_age
parameter. -1 if not specified, zero impliesprompt=login
.uiLocales
- The preferred languages and scripts for the user interface. Corresponds to the optionalui_locales
parameter.null
if not specified.claimsLocales
- The preferred languages and scripts for claims being returned. Corresponds to the optionalclaims_locales
parameter.null
if not specified.idTokenHint
- The ID Token hint. Corresponds to the optionalid_token_hint
parameter.null
if not specified.loginHint
- The login hint. Corresponds to the optionallogin_hint
parameter.null
if not specified.acrValues
- The requested Authentication Context Class Reference values. Corresponds to the optionalacr_values
parameter.null
if not specified.claims
- The individual OpenID claims to be returned. Corresponds to the optionalclaims
parameter.null
if not specified.purpose
- The transaction specific purpose,null
if not specified.requestObject
- The request object. Corresponds to the optionalrequest
parameter. Must not be specified together with a request object URI.null
if not specified.requestURI
- The request object URI. Corresponds to the optionalrequest_uri
parameter. Must not be specified together with a request object.null
if not specified.codeChallenge
- The code challenge for PKCE,null
if not specified.codeChallengeMethod
- The code challenge method for PKCE,null
if not specified.resources
- The resource URI(s),null
if not specified.includeGrantedScopes
-true
to request incremental authorisation.customParams
- Additional custom parameters, empty map ornull
if none.
-
AuthenticationRequest
@Deprecated public AuthenticationRequest(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, JWKThumbprintConfirmation dpopJKT, TrustChain trustChain, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Deprecated.Creates a new OpenID Connect authentication request with extension and custom parameters.- Parameters:
endpoint
- The URI of the authorisation endpoint. May benull
if the request is not going to be serialised.rt
- The response type set. Corresponds to theresponse_type
parameter. Must specify a valid OpenID Connect response type. Must not benull
.rm
- 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).scope
- The request scope. Corresponds to thescope
parameter. Must contain anopenid value
. Must not benull
.clientID
- The client identifier. Corresponds to theclient_id
parameter. Must not benull
.redirectURI
- The redirection URI. Corresponds to theredirect_uri
parameter. Must not benull
unless set by means of the optionalrequest_object
/request_uri
parameter.state
- The state. Corresponds to the recommendedstate
parameter.null
if not specified.nonce
- The nonce. Corresponds to thenonce
parameter. May benull
for code flow.display
- The requested display type. Corresponds to the optionaldisplay
parameter.null
if not specified.prompt
- The requested prompt. Corresponds to the optionalprompt
parameter.null
if not specified.dpopJKT
- The DPoP JWK SHA-256 thumbprint,null
if not specified.trustChain
- The OpenID Connect Federation 1.0 trust chain,null
if not specified.maxAge
- The required maximum authentication age, in seconds. Corresponds to the optionalmax_age
parameter. -1 if not specified, zero impliesprompt=login
.uiLocales
- The preferred languages and scripts for the user interface. Corresponds to the optionalui_locales
parameter.null
if not specified.claimsLocales
- The preferred languages and scripts for claims being returned. Corresponds to the optionalclaims_locales
parameter.null
if not specified.idTokenHint
- The ID Token hint. Corresponds to the optionalid_token_hint
parameter.null
if not specified.loginHint
- The login hint. Corresponds to the optionallogin_hint
parameter.null
if not specified.acrValues
- The requested Authentication Context Class Reference values. Corresponds to the optionalacr_values
parameter.null
if not specified.claims
- The individual OpenID claims to be returned. Corresponds to the optionalclaims
parameter.null
if not specified.purpose
- The transaction specific purpose,null
if not specified.requestObject
- The request object. Corresponds to the optionalrequest
parameter. Must not be specified together with a request object URI.null
if not specified.requestURI
- The request object URI. Corresponds to the optionalrequest_uri
parameter. Must not be specified together with a request object.null
if not specified.codeChallenge
- The code challenge for PKCE,null
if not specified.codeChallengeMethod
- The code challenge method for PKCE,null
if not specified.resources
- The resource URI(s),null
if not specified.includeGrantedScopes
-true
to request incremental authorisation.customParams
- Additional custom parameters, empty map ornull
if none.
-
AuthenticationRequest
public AuthenticationRequest(URI endpoint, ResponseType rt, ResponseMode rm, Scope scope, ClientID clientID, URI redirectURI, State state, Nonce nonce, Display display, Prompt prompt, JWKThumbprintConfirmation dpopJKT, TrustChain trustChain, int maxAge, List<com.nimbusds.langtag.LangTag> uiLocales, List<com.nimbusds.langtag.LangTag> claimsLocales, com.nimbusds.jwt.JWT idTokenHint, String loginHint, List<ACR> acrValues, OIDCClaimsRequest claims, String purpose, com.nimbusds.jwt.JWT requestObject, URI requestURI, CodeChallenge codeChallenge, CodeChallengeMethod codeChallengeMethod, List<AuthorizationDetail> authorizationDetails, List<URI> resources, boolean includeGrantedScopes, Map<String, List<String>> customParams) Creates a new OpenID Connect authentication request with extension and custom parameters.- Parameters:
endpoint
- The URI of the authorisation endpoint. May benull
if the request is not going to be serialised.rt
- The response type set. Corresponds to theresponse_type
parameter. Must specify a valid OpenID Connect response type. Must not benull
.rm
- 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).scope
- The request scope. Corresponds to thescope
parameter. Must contain anopenid value
. Must not benull
.clientID
- The client identifier. Corresponds to theclient_id
parameter. Must not benull
.redirectURI
- The redirection URI. Corresponds to theredirect_uri
parameter. Must not benull
unless set by means of the optionalrequest_object
/request_uri
parameter.state
- The state. Corresponds to the recommendedstate
parameter.null
if not specified.nonce
- The nonce. Corresponds to thenonce
parameter. May benull
for code flow.display
- The requested display type. Corresponds to the optionaldisplay
parameter.null
if not specified.prompt
- The requested prompt. Corresponds to the optionalprompt
parameter.null
if not specified.dpopJKT
- The DPoP JWK SHA-256 thumbprint,null
if not specified.trustChain
- The OpenID Connect Federation 1.0 trust chain,null
if not specified.maxAge
- The required maximum authentication age, in seconds. Corresponds to the optionalmax_age
parameter. -1 if not specified, zero impliesprompt=login
.uiLocales
- The preferred languages and scripts for the user interface. Corresponds to the optionalui_locales
parameter.null
if not specified.claimsLocales
- The preferred languages and scripts for claims being returned. Corresponds to the optionalclaims_locales
parameter.null
if not specified.idTokenHint
- The ID Token hint. Corresponds to the optionalid_token_hint
parameter.null
if not specified.loginHint
- The login hint. Corresponds to the optionallogin_hint
parameter.null
if not specified.acrValues
- The requested Authentication Context Class Reference values. Corresponds to the optionalacr_values
parameter.null
if not specified.claims
- The individual OpenID claims to be returned. Corresponds to the optionalclaims
parameter.null
if not specified.purpose
- The transaction specific purpose,null
if not specified.requestObject
- The request object. Corresponds to the optionalrequest
parameter. Must not be specified together with a request object URI.null
if not specified.requestURI
- The request object URI. Corresponds to the optionalrequest_uri
parameter. Must not be specified together with a request object.null
if not specified.codeChallenge
- The code challenge for PKCE,null
if not specified.codeChallengeMethod
- The code challenge method for PKCE,null
if not specified.authorizationDetails
- The authorisation details,null
if not specified.resources
- The resource URI(s),null
if not specified.includeGrantedScopes
-true
to request incremental authorisation.customParams
- Additional custom parameters, empty map ornull
if none.
-
-
Method Details
-
getRegisteredParameterNames
Returns the registered (standard) OpenID Connect authentication request parameter names.- Returns:
- The registered OpenID Connect authentication request parameter names, as a unmodifiable set.
-
getNonce
Returns the nonce. Corresponds to the conditionally optionalnonce
parameter.- Returns:
- The nonce,
null
if not specified.
-
getDisplay
Returns the requested display type. Corresponds to the optionaldisplay
parameter.- Returns:
- The requested display type,
null
if not specified.
-
getMaxAge
Returns the required maximum authentication age. Corresponds to the optionalmax_age
parameter.- Returns:
- The maximum authentication age, in seconds; -1 if not
specified, zero implies
prompt=login
.
-
getUILocales
Returns the end-user's preferred languages and scripts for the user interface, ordered by preference. Corresponds to the optionalui_locales
parameter.- Returns:
- The preferred UI locales,
null
if not specified.
-
getClaimsLocales
Returns the end-user's preferred languages and scripts for the claims being returned, ordered by preference. Corresponds to the optionalclaims_locales
parameter.- Returns:
- The preferred claims locales,
null
if not specified.
-
getIDTokenHint
Returns the ID Token hint. Corresponds to the conditionally optionalid_token_hint
parameter.- Returns:
- The ID Token hint,
null
if not specified.
-
getLoginHint
Returns the login hint. Corresponds to the optionallogin_hint
parameter.- Returns:
- The login hint,
null
if not specified.
-
getACRValues
Returns the requested Authentication Context Class Reference values. Corresponds to the optionalacr_values
parameter.- Returns:
- The requested ACR values,
null
if not specified.
-
getClaims
Deprecated.Returns the individual claims to be returned. Corresponds to the optionalclaims
parameter.- Returns:
- The individual claims to be returned,
null
if not specified. - See Also:
-
getOIDCClaims
Returns the individual OpenID claims to be returned. Corresponds to the optionalclaims
parameter.- Returns:
- The individual claims to be returned,
null
if not specified.
-
getPurpose
Returns the transaction specific purpose. Corresponds to the optionalpurpose
parameter.- Returns:
- The purpose,
null
if not specified.
-
toParameters
Description copied from class:AuthorizationRequest
Returns the URI query parameters for this authorisation request. Query parameters which are part of the authorisation endpoint are not included.Example parameters:
response_type = code client_id = s6BhdRkqt3 state = xyz redirect_uri = https://client.example.com/cb
- Overrides:
toParameters
in classAuthorizationRequest
- Returns:
- The parameters.
-
toJWTClaimsSet
Description copied from class:AuthorizationRequest
Returns the parameters for this authorisation request as a JSON Web Token (JWT) claims set. Intended for creating a request object.- Overrides:
toJWTClaimsSet
in classAuthorizationRequest
- Returns:
- The parameters as JWT claim set.
-
parse
Parses an OpenID Connect authentication request from the specified URI query parameters.Example parameters:
response_type = token id_token client_id = s6BhdRkqt3 redirect_uri = https://client.example.com/cb scope = openid profile state = af0ifjsldkj nonce = -0S6_WzA2Mj
- Parameters:
params
- The parameters. Must not benull
.- Returns:
- The OpenID Connect authentication request.
- Throws:
ParseException
- If the parameters couldn't be parsed to an OpenID Connect authentication request.
-
parse
public static AuthenticationRequest parse(URI uri, Map<String, List<String>> params) throws ParseExceptionParses an OpenID Connect authentication request from the specified URI and query parameters.Example parameters:
response_type = token id_token client_id = s6BhdRkqt3 redirect_uri = https://client.example.com/cb scope = openid profile state = af0ifjsldkj nonce = -0S6_WzA2Mj
- Parameters:
uri
- The URI of the OAuth 2.0 authorisation endpoint. May benull
if theAuthorizationRequest.toHTTPRequest(com.nimbusds.oauth2.sdk.http.HTTPRequest.Method)
method will not be used.params
- The parameters. Must not benull
.- Returns:
- The OpenID Connect authentication request.
- Throws:
ParseException
- If the parameters couldn't be parsed to an OpenID Connect authentication request.
-
parse
Parses an OpenID Connect authentication request from the specified URI query string.Example URI query string:
response_type=token%20id_token &client_id=s6BhdRkqt3 &redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb &scope=openid%20profile &state=af0ifjsldkj &nonce=n-0S6_WzA2Mj
- Parameters:
query
- The URI query string. Must not benull
.- Returns:
- The OpenID Connect authentication request.
- Throws:
ParseException
- If the query string couldn't be parsed to an OpenID Connect authentication request.
-
parse
Parses an OpenID Connect authentication request from the specified URI query string.Example URI query string:
response_type=token%20id_token &client_id=s6BhdRkqt3 &redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb &scope=openid%20profile &state=af0ifjsldkj &nonce=n-0S6_WzA2Mj
- Parameters:
uri
- The URI of the OAuth 2.0 authorisation endpoint. May benull
if theAuthorizationRequest.toHTTPRequest(com.nimbusds.oauth2.sdk.http.HTTPRequest.Method)
method will not be used.query
- The URI query string. Must not benull
.- Returns:
- The OpenID Connect authentication request.
- Throws:
ParseException
- If the query string couldn't be parsed to an OpenID Connect authentication request.
-
parse
Parses an OpenID Connect authentication request from the specified URI.Example URI:
https://server.example.com/authorize? response_type=token%20id_token &client_id=s6BhdRkqt3 &redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb &scope=openid%20profile &state=af0ifjsldkj &nonce=n-0S6_WzA2Mj
- Parameters:
uri
- The URI. Must not benull
.- Returns:
- The OpenID Connect authentication request.
- Throws:
ParseException
- If the query string couldn't be parsed to an OpenID Connect authentication request.
-
parse
Parses an authentication request from the specified HTTP GET or POST request.Example HTTP request (GET):
https://server.example.com/op/authorize? response_type=code%20id_token &client_id=s6BhdRkqt3 &redirect_uri=https%3A%2F%2Fclient.example.com%2Fcb &scope=openid &nonce=n-0S6_WzA2Mj &state=af0ifjsldkj
- Parameters:
httpRequest
- The HTTP request. Must not benull
.- Returns:
- The OpenID Connect authentication request.
- Throws:
ParseException
- If the HTTP request couldn't be parsed to an OpenID Connect authentication request.
-