Package io.jans.as.client
Class AuthorizationResponse
- java.lang.Object
-
- io.jans.as.client.BaseResponse
-
- io.jans.as.client.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(jakarta.ws.rs.core.Response clientResponse)Constructs an authorization response.AuthorizationResponse(String location)AuthorizationResponse(String location, String sharedKey, PrivateKey privateKey, String jwksUri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessToken()Returns the access token issued by the authorization server.StringgetAudience()StringgetCode()Returns the authorization code generated by the authorization server.Map<String,String>getCustomParams()StringgetDeviceSecret()StringgetErrorDescription()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.AuthorizeErrorResponseTypegetErrorType()Returns the error code when the request fails, otherwise will returnnull.StringgetErrorTypeString()StringgetErrorUri()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.IntegergetExp()IntegergetExpiresIn()Returns the lifetime in seconds of the access token.StringgetIdToken()Returns the ID Token of the for the authentication session.StringgetIssuer()StringgetResponse()io.jans.as.model.common.ResponseModegetResponseMode()StringgetScope()Returns the scope of the access token.StringgetSessionId()Gets session id.StringgetSid()StringgetState()Returns the state.io.jans.as.model.common.TokenTypegetTokenType()Returns the type of the token issued (value is case insensitive).voidsetAccessToken(String accessToken)Sets the access token issued by the authorization server.voidsetAudience(String audience)voidsetCode(String code)Sets the authorization code generated by the authorization server.voidsetCustomParams(Map<String,String> customParams)voidsetDeviceSecret(String deviceSecret)voidsetErrorDescription(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.voidsetErrorType(io.jans.as.model.authorize.AuthorizeErrorResponseType errorType)Sets the error code when the request fails, otherwise will returnnull.voidsetErrorTypeString(String errorTypeString)voidsetErrorUri(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.voidsetExp(Integer exp)voidsetExpiresIn(Integer expiresIn)Sets the lifetime in seconds of the access token.voidsetIdToken(String idToken)Sets the ID Token of the for the authentication session.voidsetIssuer(String issuer)voidsetResponse(String response)voidsetResponseMode(io.jans.as.model.common.ResponseMode responseMode)voidsetScope(String scope)Sets the scope of the access token.voidsetSessionId(String sessionId)Sets session id.voidsetSid(String sid)voidsetState(String state)Sets the state.voidsetTokenType(io.jans.as.model.common.TokenType tokenType)Sets the type of the token issued (value is case insensitive).-
Methods inherited from class io.jans.as.client.BaseResponse
getEntity, getHeaders, getLocation, getStatus, setEntity, setHeaders, setLocation, setStatus
-
-
-
-
Constructor Detail
-
AuthorizationResponse
public AuthorizationResponse(jakarta.ws.rs.core.Response clientResponse)
Constructs an authorization response.
-
AuthorizationResponse
public AuthorizationResponse(String location)
-
AuthorizationResponse
public AuthorizationResponse(String location, String sharedKey, PrivateKey privateKey, String jwksUri)
-
-
Method Detail
-
getErrorTypeString
public String getErrorTypeString()
-
setErrorTypeString
public void setErrorTypeString(String errorTypeString)
-
getCode
public String getCode()
Returns the authorization code generated by the authorization server.- Returns:
- The authorization code.
-
setCode
public void setCode(String code)
Sets the authorization code generated by the authorization server.- Parameters:
code- The authorization code.
-
getAccessToken
public String getAccessToken()
Returns the access token issued by the authorization server.- Returns:
- The access token.
-
setAccessToken
public void setAccessToken(String accessToken)
Sets the access token issued by the authorization server.- Parameters:
accessToken- The access token.
-
getSid
public String getSid()
-
setSid
public void setSid(String sid)
-
getDeviceSecret
public String getDeviceSecret()
-
setDeviceSecret
public void setDeviceSecret(String deviceSecret)
-
getSessionId
public String getSessionId()
Gets session id.- Returns:
- session id.
-
setSessionId
public void setSessionId(String sessionId)
Sets session id.- Parameters:
sessionId- session id.
-
getResponseMode
public io.jans.as.model.common.ResponseMode getResponseMode()
-
setResponseMode
public void setResponseMode(io.jans.as.model.common.ResponseMode responseMode)
-
getResponse
public String getResponse()
-
setResponse
public void setResponse(String response)
-
getIssuer
public String getIssuer()
-
setIssuer
public void setIssuer(String issuer)
-
getAudience
public String getAudience()
-
setAudience
public void setAudience(String audience)
-
getExp
public Integer getExp()
-
setExp
public void setExp(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 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(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 String getScope()
Returns the scope of the access token.- Returns:
- The scope of the access token.
-
setScope
public void setScope(String scope)
Sets the scope of the access token.- Parameters:
scope- The scope of the access token.
-
getIdToken
public String getIdToken()
Returns the ID Token of the for the authentication session.- Returns:
- The ID Token.
-
setIdToken
public void setIdToken(String idToken)
Sets the ID Token of the for the authentication session.- Parameters:
idToken- The ID Token.
-
getState
public 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(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 returnnull.- 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 returnnull.- Parameters:
errorType- The error code when the request fails.
-
getErrorDescription
public 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(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 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(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.
-
-