Package io.jans.as.client
Class TokenResponse
- java.lang.Object
-
- io.jans.as.client.BaseResponse
-
- io.jans.as.client.BaseResponseWithErrors<io.jans.as.model.token.TokenErrorResponseType>
-
- io.jans.as.client.TokenResponse
-
public class TokenResponse extends BaseResponseWithErrors<io.jans.as.model.token.TokenErrorResponseType>
Represents a token response received from the authorization server.- Author:
- Javier Rojas Blum, Yuriy Z
-
-
Field Summary
-
Fields inherited from class io.jans.as.client.BaseResponse
entity, headers, location, status
-
-
Constructor Summary
Constructors Constructor Description TokenResponse()TokenResponse(jakarta.ws.rs.core.Response clientResponse)Constructs a token response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.jans.as.model.token.TokenErrorResponseTypefromString(String str)StringgetAccessToken()Returns the access token issued by the authorization server.StringgetDeviceToken()IntegergetExpiresIn()Returns the lifetime in seconds of the access token.StringgetIdToken()Gets the value of the id token.io.jans.as.model.common.ExchangeTokenTypegetIssuedTokenType()Gets issued token type.StringgetRefreshToken()Returns the refresh token which can be used to obtain new access tokens using the same authorization grant.StringgetScope()Returns the scope of the access token.io.jans.as.model.common.TokenTypegetTokenType()Returns the type of the token issued.voidinjectDataFromJson()voidinjectDataFromJson(String json)voidsetAccessToken(String accessToken)Sets the access token issued by the authorization server.voidsetDeviceToken(String deviceToken)voidsetExpiresIn(Integer expiresIn)Sets the lifetime in seconds of the access token.voidsetIdToken(String idToken)Sets the value of the id token.voidsetIssuedTokenType(io.jans.as.model.common.ExchangeTokenType issuedTokenType)Sets issued token typevoidsetRefreshToken(String refreshToken)Sets the refresh token which can be used to obtain new access tokens using the same authorization grant.voidsetScope(String scope)Sets the scope of the access token.voidsetTokenType(io.jans.as.model.common.TokenType tokenType)Sets the type of the token issued.-
Methods inherited from class io.jans.as.client.BaseResponseWithErrors
getClaim, getClaimMap, getClaims, getErrorDescription, getErrorType, getErrorUri, getFirstClaim, injectErrorIfExistSilently, injectErrorIfExistSilently, setClaimMap, setErrorDescription, setErrorType, setErrorUri, toString
-
Methods inherited from class io.jans.as.client.BaseResponse
getEntity, getHeaders, getLocation, getStatus, setEntity, setHeaders, setLocation, setStatus
-
-
-
-
Method Detail
-
fromString
public io.jans.as.model.token.TokenErrorResponseType fromString(String str)
- Specified by:
fromStringin classBaseResponseWithErrors<io.jans.as.model.token.TokenErrorResponseType>
-
injectDataFromJson
public void injectDataFromJson()
-
injectDataFromJson
public void injectDataFromJson(String json)
- Overrides:
injectDataFromJsonin classBaseResponseWithErrors<io.jans.as.model.token.TokenErrorResponseType>
-
getDeviceToken
public String getDeviceToken()
-
setDeviceToken
public void setDeviceToken(String deviceToken)
-
getAccessToken
public String getAccessToken()
Returns the access token issued by the authorization server.- Returns:
- The access token issued by the authorization server.
-
setAccessToken
public void setAccessToken(String accessToken)
Sets the access token issued by the authorization server.- Parameters:
accessToken- The access token issued by the authorization server.
-
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 issued.
-
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 issued.
-
getIssuedTokenType
public io.jans.as.model.common.ExchangeTokenType getIssuedTokenType()
Gets issued token type.- Returns:
- issued token type
-
setIssuedTokenType
public void setIssuedTokenType(io.jans.as.model.common.ExchangeTokenType issuedTokenType)
Sets issued token type- Parameters:
issuedTokenType- issued token type
-
getExpiresIn
public Integer getExpiresIn()
Returns the lifetime in seconds of the access token.- Returns:
- The lifetime in seconds of the access token.
-
setExpiresIn
public void setExpiresIn(Integer expiresIn)
Sets the lifetime in seconds of the access token.- Parameters:
expiresIn- The lifetime in seconds of the access token.
-
getRefreshToken
public String getRefreshToken()
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant.- Returns:
- The refresh token.
-
setRefreshToken
public void setRefreshToken(String refreshToken)
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant.- Parameters:
refreshToken- The refresh 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()
Gets the value of the id token.- Returns:
- The id token.
-
setIdToken
public void setIdToken(String idToken)
Sets the value of the id token.- Parameters:
idToken- The id token.
-
-