Class 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
    • Constructor Detail

      • TokenResponse

        public TokenResponse()
      • TokenResponse

        public TokenResponse​(jakarta.ws.rs.core.Response clientResponse)
        Constructs a token response.
        Parameters:
        clientResponse - The response
    • Method Detail

      • fromString

        public io.jans.as.model.token.TokenErrorResponseType fromString​(String str)
        Specified by:
        fromString in class BaseResponseWithErrors<io.jans.as.model.token.TokenErrorResponseType>
      • injectDataFromJson

        public void injectDataFromJson()
      • 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.