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
ConstructorsConstructorDescriptionTokenResponse(jakarta.ws.rs.core.Response clientResponse) Constructs a token response. -
Method Summary
Modifier and TypeMethodDescriptionio.jans.as.model.token.TokenErrorResponseTypefromString(String str) Returns the access token issued by the authorization server.Returns the lifetime in seconds of the access token.Gets the value of the id token.io.jans.as.model.common.ExchangeTokenTypeGets issued token type.Returns the refresh token which can be used to obtain new access tokens using the same authorization grant.getScope()Returns the scope of the access token.io.jans.as.model.common.TokenTypeReturns the type of the token issued.voidvoidinjectDataFromJson(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.voidSets 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, toStringMethods inherited from class io.jans.as.client.BaseResponse
getEntity, getHeaders, getLocation, getStatus, setEntity, setHeaders, setLocation, setStatus
-
Constructor Details
-
TokenResponse
public TokenResponse() -
TokenResponse
public TokenResponse(jakarta.ws.rs.core.Response clientResponse) Constructs a token response.- Parameters:
clientResponse- The response
-
-
Method Details
-
fromString
- Specified by:
fromStringin classBaseResponseWithErrors<io.jans.as.model.token.TokenErrorResponseType>
-
injectDataFromJson
public void injectDataFromJson() -
injectDataFromJson
- Overrides:
injectDataFromJsonin classBaseResponseWithErrors<io.jans.as.model.token.TokenErrorResponseType>
-
getDeviceToken
-
setDeviceToken
-
getAccessToken
Returns the access token issued by the authorization server.- Returns:
- The access token issued by the authorization server.
-
setAccessToken
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
Returns the lifetime in seconds of the access token.- Returns:
- The lifetime in seconds of the access token.
-
setExpiresIn
Sets the lifetime in seconds of the access token.- Parameters:
expiresIn- The lifetime in seconds of the access token.
-
getRefreshToken
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant.- Returns:
- The refresh token.
-
setRefreshToken
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant.- Parameters:
refreshToken- The refresh token.
-
getScope
Returns the scope of the access token.- Returns:
- The scope of the access token.
-
setScope
Sets the scope of the access token.- Parameters:
scope- The scope of the access token.
-
getIdToken
Gets the value of the id token.- Returns:
- The id token.
-
setIdToken
Sets the value of the id token.- Parameters:
idToken- The id token.
-