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 String
getAccessToken()
Returns the access token issued by the authorization server.String
getAudience()
String
getCode()
Returns the authorization code generated by the authorization server.Map<String,String>
getCustomParams()
String
getDeviceSecret()
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 returnnull
.String
getErrorTypeString()
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.Integer
getExp()
Integer
getExpiresIn()
Returns the lifetime in seconds of the access token.String
getIdToken()
Returns the ID Token of the for the authentication session.String
getIssuer()
String
getResponse()
io.jans.as.model.common.ResponseMode
getResponseMode()
String
getScope()
Returns the scope of the access token.String
getSessionId()
Gets session id.String
getSid()
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(String accessToken)
Sets the access token issued by the authorization server.void
setAudience(String audience)
void
setCode(String code)
Sets the authorization code generated by the authorization server.void
setCustomParams(Map<String,String> customParams)
void
setDeviceSecret(String deviceSecret)
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.void
setErrorType(io.jans.as.model.authorize.AuthorizeErrorResponseType errorType)
Sets the error code when the request fails, otherwise will returnnull
.void
setErrorTypeString(String errorTypeString)
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.void
setExp(Integer exp)
void
setExpiresIn(Integer expiresIn)
Sets the lifetime in seconds of the access token.void
setIdToken(String idToken)
Sets the ID Token of the for the authentication session.void
setIssuer(String issuer)
void
setResponse(String response)
void
setResponseMode(io.jans.as.model.common.ResponseMode responseMode)
void
setScope(String scope)
Sets the scope of the access token.void
setSessionId(String sessionId)
Sets session id.void
setSid(String sid)
void
setState(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 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.
-
-