Package io.jans.as.client
Class AuthorizationRequest
java.lang.Object
io.jans.as.client.BaseRequest
io.jans.as.client.AuthorizationRequest
Represents an authorization request to send to the authorization server.
- Version:
- April 25, 2022
- Author:
- Javier Rojas Blum
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuthorizationRequest
(String requestUri) AuthorizationRequest
(List<io.jans.as.model.common.ResponseType> responseTypes, String clientId, List<String> scopes, String redirectUri, String nonce) Constructs an authorization request. -
Method Summary
Modifier and TypeMethodDescriptionio.jans.as.model.authorize.CodeVerifier
Gets authorization detailsorg.json.JSONObject
Returns the client identifier.io.jans.as.model.common.Display
Returns an ASCII string value that specifies how the Authorization Server displays the authentication page to the End-User.Gets dpop_jktgetNonce()
Returns a string value used to associate a user agent session with an ID Token, and to mitigate replay attacks.Returns a collection of parameters of the authorization request.List<io.jans.as.model.common.Prompt>
Returns a space delimited list of ASCII strings that can contain the values login, consent, select_account, and none.Returns a query string with the parameters of the authorization request.Returns the redirection URI.Returns a JWT encoded OpenID Request Object.Returns an URL that points to an OpenID Request Object.io.jans.as.model.common.ResponseMode
List<io.jans.as.model.common.ResponseType>
Returns the response types.Returns the scopes of the access request.Gets session id.getState()
Returns the state.boolean
Returns whether session id is requested.boolean
void
setAccessToken
(String accessToken) void
setAcrValues
(List<String> acrValues) void
setAuthorizationDetails
(String authorizationDetails) Authorization detailsvoid
setClaims
(org.json.JSONObject claims) void
setClaimsLocales
(List<String> claimsLocales) void
setClientId
(String clientId) Sets the client identifier.void
setCodeChallenge
(String codeChallenge) void
setCodeChallengeMethod
(String codeChallengeMethod) void
setCustomResponseHeaders
(Map<String, String> customResponseHeaders) void
setDisplay
(io.jans.as.model.common.Display display) Sets an ASCII string value that specifies how the Authorization Server displays the authentication page to the End-User.void
setDpopJkt
(String dpopJkt) Sets dpop_jktvoid
setIdTokenHint
(String idTokenHint) void
setLoginHint
(String loginHint) void
void
Sets a string value used to associate a user agent session with an ID Token, and to mitigate replay attacks.void
setPrompts
(List<io.jans.as.model.common.Prompt> prompts) void
setRedirectUri
(String redirectUri) Sets the redirection URI.void
setRegistration
(String registration) void
setRequest
(String request) Sets a JWT encoded OpenID Request Object.void
setRequestSessionId
(boolean requestSessionId) Sets whether session id should be requested.void
setRequestUri
(String requestUri) Sets an URL that points to an OpenID Request Object.void
setResponseMode
(io.jans.as.model.common.ResponseMode responseMode) void
setResponseTypes
(List<io.jans.as.model.common.ResponseType> responseTypes) Sets the response types.void
Sets the scope of the access request.void
setSessionId
(String sessionId) Sets session id.void
Sets the state.void
setUiLocales
(List<String> uiLocales) void
setUseNoRedirectHeader
(boolean useNoRedirectHeader) Methods inherited from class io.jans.as.client.BaseRequest
addCustomParameter, getAuthenticationMethod, getAuthorizationMethod, getAuthPassword, getAuthUsername, getContentType, getCredentials, getCustomParameters, getEncodedCredentials, getEncodedCredentials, getJSONParameters, getMediaType, hasCredentials, setAuthenticationMethod, setAuthorizationMethod, setAuthPassword, setAuthUsername, setContentType, setMediaType
-
Field Details
-
NO_REDIRECT_HEADER
- See Also:
-
-
Constructor Details
-
AuthorizationRequest
public AuthorizationRequest(List<io.jans.as.model.common.ResponseType> responseTypes, String clientId, List<String> scopes, String redirectUri, String nonce) Constructs an authorization request.- Parameters:
responseTypes
- The response type informs the authorization server of the desired response type: code, token, id_token a combination of them. The response type parameter is mandatory.clientId
- The client identifier is mandatory.scopes
- The scope of the access request.redirectUri
- Redirection URInonce
- A string value used to associate a user agent session with an ID Token, and to mitigate replay attacks.
-
AuthorizationRequest
-
-
Method Details
-
generateAndSetCodeChallengeWithMethod
public io.jans.as.model.authorize.CodeVerifier generateAndSetCodeChallengeWithMethod() -
getCodeChallenge
-
getCodeChallengeMethod
-
setCodeChallenge
-
setCodeChallengeMethod
-
getDpopJkt
Gets dpop_jkt- Returns:
- dpop_jkt
-
setDpopJkt
Sets dpop_jkt- Parameters:
dpopJkt
- dpop_jkt
-
getAuthorizationDetails
Gets authorization details- Returns:
- authorization details
-
setAuthorizationDetails
Authorization details- Parameters:
authorizationDetails
- authorization details
-
getResponseTypes
Returns the response types.- Returns:
- The response types.
-
setResponseTypes
Sets the response types.- Parameters:
responseTypes
- The response types.
-
getClientId
Returns the client identifier.- Returns:
- The client identifier.
-
setClientId
Sets the client identifier.- Parameters:
clientId
- The client identifier.
-
getScopes
Returns the scopes of the access request. The authorization endpoint allow the client to specify the scope of the access request using the scope request parameter. In turn, the authorization server uses the scope response parameter to inform the client of the scope of the access token issued. The value of the scope parameter is expressed as a list of space-delimited, case sensitive strings.- Returns:
- The scopes of the access request.
-
setScopes
Sets the scope of the access request. The authorization endpoint allow the client to specify the scope of the access request using the scope request parameter. In turn, the authorization server uses the scope response parameter to inform the client of the scope of the access token issued. The value of the scope parameter is expressed as a list of space-delimited, case sensitive strings.- Parameters:
scopes
- The scope of the access request.
-
getRedirectUri
Returns the redirection URI.- Returns:
- The redirection URI.
-
setRedirectUri
Sets the redirection URI.- Parameters:
redirectUri
- The redirection URI.
-
getState
Returns the state. The state is an opaque value used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client. The parameter should be used for preventing cross-site request forgery.- Returns:
- The state.
-
setState
Sets the state. The state is an opaque value used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client. The parameter should be used for preventing cross-site request forgery.- Parameters:
state
- The state.
-
getResponseMode
public io.jans.as.model.common.ResponseMode getResponseMode() -
setResponseMode
public void setResponseMode(io.jans.as.model.common.ResponseMode responseMode) -
getNonce
Returns a string value used to associate a user agent session with an ID Token, and to mitigate replay attacks.- Returns:
- The nonce value.
-
setNonce
Sets a string value used to associate a user agent session with an ID Token, and to mitigate replay attacks.- Parameters:
nonce
- The nonce value.
-
getDisplay
public io.jans.as.model.common.Display getDisplay()Returns an ASCII string value that specifies how the Authorization Server displays the authentication page to the End-User.- Returns:
- The display value.
-
setDisplay
public void setDisplay(io.jans.as.model.common.Display display) Sets an ASCII string value that specifies how the Authorization Server displays the authentication page to the End-User.- Parameters:
display
- The display value.
-
getPrompts
Returns a space delimited list of ASCII strings that can contain the values login, consent, select_account, and none.- Returns:
- The prompt list.
-
setPrompts
-
getMaxAge
-
setMaxAge
-
getUiLocales
-
setUiLocales
-
getClaimsLocales
-
setClaimsLocales
-
getIdTokenHint
-
setIdTokenHint
-
getLoginHint
-
setLoginHint
-
getAcrValues
-
setAcrValues
-
getClaims
public org.json.JSONObject getClaims() -
setClaims
public void setClaims(org.json.JSONObject claims) -
getRegistration
-
setRegistration
-
getRequest
Returns a JWT encoded OpenID Request Object.- Returns:
- A JWT encoded OpenID Request Object.
-
setRequest
Sets a JWT encoded OpenID Request Object.- Parameters:
request
- A JWT encoded OpenID Request Object.
-
getRequestUri
Returns an URL that points to an OpenID Request Object.- Returns:
- An URL that points to an OpenID Request Object.
-
setRequestUri
Sets an URL that points to an OpenID Request Object.- Parameters:
requestUri
- An URL that points to an OpenID Request Object.
-
isRequestSessionId
public boolean isRequestSessionId()Returns whether session id is requested.- Returns:
- whether session id is requested
-
setRequestSessionId
public void setRequestSessionId(boolean requestSessionId) Sets whether session id should be requested.- Parameters:
requestSessionId
- session id.
-
getSessionId
Gets session id.- Returns:
- session id.
-
setSessionId
Sets session id.- Parameters:
sessionId
- session id
-
getAccessToken
-
setAccessToken
-
isUseNoRedirectHeader
public boolean isUseNoRedirectHeader() -
setUseNoRedirectHeader
public void setUseNoRedirectHeader(boolean useNoRedirectHeader) -
getResponseTypesAsString
-
getScopesAsString
-
getPromptsAsString
-
getUiLocalesAsString
-
getClaimsLocalesAsString
-
getAcrValuesAsString
-
getCustomResponseHeadersAsString
- Throws:
org.json.JSONException
-
getCustomResponseHeaders
-
setCustomResponseHeaders
-
getClaimsAsString
-
getParQueryString
-
getQueryString
Returns a query string with the parameters of the authorization request. Anynull
or empty parameter will be omitted.- Specified by:
getQueryString
in classBaseRequest
- Returns:
- A query string of parameters.
-
getParameters
Returns a collection of parameters of the authorization request. Anynull
or empty parameter will be omitted.- Overrides:
getParameters
in classBaseRequest
- Returns:
- A collection of parameters.
-