Class AuthorizationRequest

java.lang.Object
io.jans.as.client.BaseRequest
io.jans.as.client.AuthorizationRequest

public class AuthorizationRequest extends BaseRequest
Represents an authorization request to send to the authorization server.
Version:
April 25, 2022
Author:
Javier Rojas Blum
  • Field Details

  • 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 URI
      nonce - A string value used to associate a user agent session with an ID Token, and to mitigate replay attacks.
    • AuthorizationRequest

      public AuthorizationRequest(String requestUri)
  • Method Details

    • generateAndSetCodeChallengeWithMethod

      public io.jans.as.model.authorize.CodeVerifier generateAndSetCodeChallengeWithMethod()
    • getCodeChallenge

      public String getCodeChallenge()
    • getCodeChallengeMethod

      public String getCodeChallengeMethod()
    • setCodeChallenge

      public void setCodeChallenge(String codeChallenge)
    • setCodeChallengeMethod

      public void setCodeChallengeMethod(String codeChallengeMethod)
    • getDpopJkt

      public String getDpopJkt()
      Gets dpop_jkt
      Returns:
      dpop_jkt
    • setDpopJkt

      public void setDpopJkt(String dpopJkt)
      Sets dpop_jkt
      Parameters:
      dpopJkt - dpop_jkt
    • getAuthorizationDetails

      public String getAuthorizationDetails()
      Gets authorization details
      Returns:
      authorization details
    • setAuthorizationDetails

      public void setAuthorizationDetails(String authorizationDetails)
      Authorization details
      Parameters:
      authorizationDetails - authorization details
    • getResponseTypes

      public List<io.jans.as.model.common.ResponseType> getResponseTypes()
      Returns the response types.
      Returns:
      The response types.
    • setResponseTypes

      public void setResponseTypes(List<io.jans.as.model.common.ResponseType> responseTypes)
      Sets the response types.
      Parameters:
      responseTypes - The response types.
    • getClientId

      public String getClientId()
      Returns the client identifier.
      Returns:
      The client identifier.
    • setClientId

      public void setClientId(String clientId)
      Sets the client identifier.
      Parameters:
      clientId - The client identifier.
    • getScopes

      public List<String> 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

      public void setScopes(List<String> scopes)
      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

      public String getRedirectUri()
      Returns the redirection URI.
      Returns:
      The redirection URI.
    • setRedirectUri

      public void setRedirectUri(String redirectUri)
      Sets the redirection URI.
      Parameters:
      redirectUri - The redirection URI.
    • getState

      public String 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

      public void setState(String state)
      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

      public String 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

      public void setNonce(String nonce)
      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

      public List<io.jans.as.model.common.Prompt> 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

      public void setPrompts(List<io.jans.as.model.common.Prompt> prompts)
    • getMaxAge

      public Integer getMaxAge()
    • setMaxAge

      public void setMaxAge(Integer maxAge)
    • getUiLocales

      public List<String> getUiLocales()
    • setUiLocales

      public void setUiLocales(List<String> uiLocales)
    • getClaimsLocales

      public List<String> getClaimsLocales()
    • setClaimsLocales

      public void setClaimsLocales(List<String> claimsLocales)
    • getIdTokenHint

      public String getIdTokenHint()
    • setIdTokenHint

      public void setIdTokenHint(String idTokenHint)
    • getLoginHint

      public String getLoginHint()
    • setLoginHint

      public void setLoginHint(String loginHint)
    • getAcrValues

      public List<String> getAcrValues()
    • setAcrValues

      public void setAcrValues(List<String> acrValues)
    • getClaims

      public org.json.JSONObject getClaims()
    • setClaims

      public void setClaims(org.json.JSONObject claims)
    • getRegistration

      public String getRegistration()
    • setRegistration

      public void setRegistration(String registration)
    • getRequest

      public String getRequest()
      Returns a JWT encoded OpenID Request Object.
      Returns:
      A JWT encoded OpenID Request Object.
    • setRequest

      public void setRequest(String request)
      Sets a JWT encoded OpenID Request Object.
      Parameters:
      request - A JWT encoded OpenID Request Object.
    • getRequestUri

      public String getRequestUri()
      Returns an URL that points to an OpenID Request Object.
      Returns:
      An URL that points to an OpenID Request Object.
    • setRequestUri

      public void setRequestUri(String requestUri)
      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

      public String getSessionId()
      Gets session id.
      Returns:
      session id.
    • setSessionId

      public void setSessionId(String sessionId)
      Sets session id.
      Parameters:
      sessionId - session id
    • getAccessToken

      public String getAccessToken()
    • setAccessToken

      public void setAccessToken(String accessToken)
    • isUseNoRedirectHeader

      public boolean isUseNoRedirectHeader()
    • setUseNoRedirectHeader

      public void setUseNoRedirectHeader(boolean useNoRedirectHeader)
    • getResponseTypesAsString

      public String getResponseTypesAsString()
    • getScopesAsString

      public String getScopesAsString()
    • getPromptsAsString

      public String getPromptsAsString()
    • getUiLocalesAsString

      public String getUiLocalesAsString()
    • getClaimsLocalesAsString

      public String getClaimsLocalesAsString()
    • getAcrValuesAsString

      public String getAcrValuesAsString()
    • getCustomResponseHeadersAsString

      public String getCustomResponseHeadersAsString() throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getCustomResponseHeaders

      public Map<String,String> getCustomResponseHeaders()
    • setCustomResponseHeaders

      public void setCustomResponseHeaders(Map<String,String> customResponseHeaders)
    • getClaimsAsString

      public String getClaimsAsString()
    • getParQueryString

      public String getParQueryString()
    • getQueryString

      public String getQueryString()
      Returns a query string with the parameters of the authorization request. Any null or empty parameter will be omitted.
      Specified by:
      getQueryString in class BaseRequest
      Returns:
      A query string of parameters.
    • getParameters

      public Map<String,String> getParameters()
      Returns a collection of parameters of the authorization request. Any null or empty parameter will be omitted.
      Overrides:
      getParameters in class BaseRequest
      Returns:
      A collection of parameters.