Class AuthorizationResponse


  • public class AuthorizationResponse
    extends BaseResponse
    Represents an authorization response received from the authorization server.
    Version:
    November 22, 2021
    Author:
    Javier Rojas Blum
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthorizationResponse​(java.lang.String location)  
      AuthorizationResponse​(java.lang.String location, java.lang.String sharedKey, java.security.PrivateKey privateKey, java.lang.String jwksUri)  
      AuthorizationResponse​(javax.ws.rs.core.Response clientResponse)
      Constructs an authorization response.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAccessToken()
      Returns the access token issued by the authorization server.
      java.lang.String getAudience()  
      java.lang.String getCode()
      Returns the authorization code generated by the authorization server.
      java.util.Map<java.lang.String,​java.lang.String> getCustomParams()  
      java.lang.String getErrorDescription()
      Returns a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.
      io.jans.as.model.authorize.AuthorizeErrorResponseType getErrorType()
      Returns the error code when the request fails, otherwise will return null.
      java.lang.String getErrorUri()
      Returns a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
      java.lang.Integer getExp()  
      java.lang.Integer getExpiresIn()
      Returns the lifetime in seconds of the access token.
      java.lang.String getIdToken()
      Returns the ID Token of the for the authentication session.
      java.lang.String getIssuer()  
      java.lang.String getResponse()  
      io.jans.as.model.common.ResponseMode getResponseMode()  
      java.lang.String getScope()
      Returns the scope of the access token.
      java.lang.String getSessionId()
      Gets session id.
      java.lang.String getSid()  
      java.lang.String getState()
      Returns the state.
      io.jans.as.model.common.TokenType getTokenType()
      Returns the type of the token issued (value is case insensitive).
      void setAccessToken​(java.lang.String accessToken)
      Sets the access token issued by the authorization server.
      void setAudience​(java.lang.String audience)  
      void setCode​(java.lang.String code)
      Sets the authorization code generated by the authorization server.
      void setCustomParams​(java.util.Map<java.lang.String,​java.lang.String> customParams)  
      void setErrorDescription​(java.lang.String errorDescription)
      Sets a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.
      void setErrorType​(io.jans.as.model.authorize.AuthorizeErrorResponseType errorType)
      Sets the error code when the request fails, otherwise will return null.
      void setErrorUri​(java.lang.String errorUri)
      Sets a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
      void setExp​(java.lang.Integer exp)  
      void setExpiresIn​(java.lang.Integer expiresIn)
      Sets the lifetime in seconds of the access token.
      void setIdToken​(java.lang.String idToken)
      Sets the ID Token of the for the authentication session.
      void setIssuer​(java.lang.String issuer)  
      void setResponse​(java.lang.String response)  
      void setResponseMode​(io.jans.as.model.common.ResponseMode responseMode)  
      void setScope​(java.lang.String scope)
      Sets the scope of the access token.
      void setSessionId​(java.lang.String sessionId)
      Sets session id.
      void setSid​(java.lang.String sid)  
      void setState​(java.lang.String state)
      Sets the state.
      void setTokenType​(io.jans.as.model.common.TokenType tokenType)
      Sets the type of the token issued (value is case insensitive).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • response

        protected java.lang.String response
      • issuer

        protected java.lang.String issuer
      • audience

        protected java.lang.String audience
      • exp

        protected java.lang.Integer exp
    • Constructor Detail

      • AuthorizationResponse

        public AuthorizationResponse​(javax.ws.rs.core.Response clientResponse)
        Constructs an authorization response.
      • AuthorizationResponse

        public AuthorizationResponse​(java.lang.String location)
      • AuthorizationResponse

        public AuthorizationResponse​(java.lang.String location,
                                     java.lang.String sharedKey,
                                     java.security.PrivateKey privateKey,
                                     java.lang.String jwksUri)
    • Method Detail

      • getCode

        public java.lang.String getCode()
        Returns the authorization code generated by the authorization server.
        Returns:
        The authorization code.
      • setCode

        public void setCode​(java.lang.String code)
        Sets the authorization code generated by the authorization server.
        Parameters:
        code - The authorization code.
      • getAccessToken

        public java.lang.String getAccessToken()
        Returns the access token issued by the authorization server.
        Returns:
        The access token.
      • setAccessToken

        public void setAccessToken​(java.lang.String accessToken)
        Sets the access token issued by the authorization server.
        Parameters:
        accessToken - The access token.
      • getSid

        public java.lang.String getSid()
      • setSid

        public void setSid​(java.lang.String sid)
      • 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.
      • getCustomParams

        public java.util.Map<java.lang.String,​java.lang.String> getCustomParams()
      • setCustomParams

        public void setCustomParams​(java.util.Map<java.lang.String,​java.lang.String> customParams)
      • getResponseMode

        public io.jans.as.model.common.ResponseMode getResponseMode()
      • setResponseMode

        public void setResponseMode​(io.jans.as.model.common.ResponseMode responseMode)
      • getResponse

        public java.lang.String getResponse()
      • setResponse

        public void setResponse​(java.lang.String response)
      • getIssuer

        public java.lang.String getIssuer()
      • setIssuer

        public void setIssuer​(java.lang.String issuer)
      • getAudience

        public java.lang.String getAudience()
      • setAudience

        public void setAudience​(java.lang.String audience)
      • getExp

        public java.lang.Integer getExp()
      • setExp

        public void setExp​(java.lang.Integer exp)
      • getTokenType

        public io.jans.as.model.common.TokenType getTokenType()
        Returns the type of the token issued (value is case insensitive).
        Returns:
        The type of the token.
      • setTokenType

        public void setTokenType​(io.jans.as.model.common.TokenType tokenType)
        Sets the type of the token issued (value is case insensitive).
        Parameters:
        tokenType - The type of the token.
      • getExpiresIn

        public java.lang.Integer getExpiresIn()
        Returns the lifetime in seconds of the access token. For example, the value 3600 denotes that the access token will expire in one hour from the time the response was generated.
        Returns:
        The lifetime in seconds of the access token.
      • setExpiresIn

        public void setExpiresIn​(java.lang.Integer expiresIn)
        Sets the lifetime in seconds of the access token. For example, the value 3600 denotes that the access token will expire in one hour from the time the response was generated.
        Parameters:
        expiresIn - The lifetime in seconds of the access token.
      • getScope

        public java.lang.String getScope()
        Returns the scope of the access token.
        Returns:
        The scope of the access token.
      • setScope

        public void setScope​(java.lang.String scope)
        Sets the scope of the access token.
        Parameters:
        scope - The scope of the access token.
      • getIdToken

        public java.lang.String getIdToken()
        Returns the ID Token of the for the authentication session.
        Returns:
        The ID Token.
      • setIdToken

        public void setIdToken​(java.lang.String idToken)
        Sets the ID Token of the for the authentication session.
        Parameters:
        idToken - The ID Token.
      • getState

        public java.lang.String getState()
        Returns the state. If the state parameter was present in the client authorization request, the exact value received from the client.
        Returns:
        The state.
      • setState

        public void setState​(java.lang.String state)
        Sets the state. If the state parameter was present in the client authorization request, the exact value received from the client.
        Parameters:
        state - The state.
      • getErrorType

        public io.jans.as.model.authorize.AuthorizeErrorResponseType getErrorType()
        Returns the error code when the request fails, otherwise will return null.
        Returns:
        The error code when the request fails.
      • setErrorType

        public void setErrorType​(io.jans.as.model.authorize.AuthorizeErrorResponseType errorType)
        Sets the error code when the request fails, otherwise will return null.
        Parameters:
        errorType - The error code when the request fails.
      • getErrorDescription

        public java.lang.String getErrorDescription()
        Returns a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.
        Returns:
        The error description.
      • setErrorDescription

        public void setErrorDescription​(java.lang.String errorDescription)
        Sets a human-readable UTF-8 encoded text providing additional information, used to assist the client developer in understanding the error that occurred.
        Parameters:
        errorDescription - The error description.
      • getErrorUri

        public java.lang.String getErrorUri()
        Returns a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
        Returns:
        A URI with information about the error.
      • setErrorUri

        public void setErrorUri​(java.lang.String errorUri)
        Sets a URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
        Parameters:
        errorUri - A URI with information about the error.