Class 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 Detail

      • NO_REDIRECT_HEADER

        public static final java.lang.String NO_REDIRECT_HEADER
        See Also:
        Constant Field Values
    • Constructor Detail

      • AuthorizationRequest

        public AuthorizationRequest​(java.util.List<io.jans.as.model.common.ResponseType> responseTypes,
                                    java.lang.String clientId,
                                    java.util.List<java.lang.String> scopes,
                                    java.lang.String redirectUri,
                                    java.lang.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​(java.lang.String requestUri)
    • Method Detail

      • generateAndSetCodeChallengeWithMethod

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

        public java.lang.String getCodeChallenge()
      • getCodeChallengeMethod

        public java.lang.String getCodeChallengeMethod()
      • setCodeChallenge

        public void setCodeChallenge​(java.lang.String codeChallenge)
      • setCodeChallengeMethod

        public void setCodeChallengeMethod​(java.lang.String codeChallengeMethod)
      • getResponseTypes

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

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

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

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

        public java.util.List<java.lang.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​(java.util.List<java.lang.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 java.lang.String getRedirectUri()
        Returns the redirection URI.
        Returns:
        The redirection URI.
      • setRedirectUri

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

        public java.lang.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​(java.lang.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 java.lang.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​(java.lang.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 java.util.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​(java.util.List<io.jans.as.model.common.Prompt> prompts)
      • getMaxAge

        public java.lang.Integer getMaxAge()
      • setMaxAge

        public void setMaxAge​(java.lang.Integer maxAge)
      • getUiLocales

        public java.util.List<java.lang.String> getUiLocales()
      • setUiLocales

        public void setUiLocales​(java.util.List<java.lang.String> uiLocales)
      • getClaimsLocales

        public java.util.List<java.lang.String> getClaimsLocales()
      • setClaimsLocales

        public void setClaimsLocales​(java.util.List<java.lang.String> claimsLocales)
      • getIdTokenHint

        public java.lang.String getIdTokenHint()
      • setIdTokenHint

        public void setIdTokenHint​(java.lang.String idTokenHint)
      • getLoginHint

        public java.lang.String getLoginHint()
      • setLoginHint

        public void setLoginHint​(java.lang.String loginHint)
      • getAcrValues

        public java.util.List<java.lang.String> getAcrValues()
      • setAcrValues

        public void setAcrValues​(java.util.List<java.lang.String> acrValues)
      • getClaims

        public org.json.JSONObject getClaims()
      • setClaims

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

        public java.lang.String getRegistration()
      • setRegistration

        public void setRegistration​(java.lang.String registration)
      • getRequest

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

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

        public java.lang.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​(java.lang.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 java.lang.String getSessionId()
        Gets session id.
        Returns:
        session id.
      • setSessionId

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

        public java.lang.String getAccessToken()
      • setAccessToken

        public void setAccessToken​(java.lang.String accessToken)
      • isUseNoRedirectHeader

        public boolean isUseNoRedirectHeader()
      • setUseNoRedirectHeader

        public void setUseNoRedirectHeader​(boolean useNoRedirectHeader)
      • getResponseTypesAsString

        public java.lang.String getResponseTypesAsString()
      • getScopesAsString

        public java.lang.String getScopesAsString()
      • getPromptsAsString

        public java.lang.String getPromptsAsString()
      • getUiLocalesAsString

        public java.lang.String getUiLocalesAsString()
      • getClaimsLocalesAsString

        public java.lang.String getClaimsLocalesAsString()
      • getAcrValuesAsString

        public java.lang.String getAcrValuesAsString()
      • getCustomResponseHeadersAsString

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

        public java.util.Map<java.lang.String,​java.lang.String> getCustomResponseHeaders()
      • setCustomResponseHeaders

        public void setCustomResponseHeaders​(java.util.Map<java.lang.String,​java.lang.String> customResponseHeaders)
      • getClaimsAsString

        public java.lang.String getClaimsAsString()
      • getParQueryString

        public java.lang.String getParQueryString()
      • getQueryString

        public java.lang.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 java.util.Map<java.lang.String,​java.lang.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.