Class AccessToken

  • All Implemented Interfaces:
    io.jans.orm.model.base.Deletable, Serializable

    public class AccessToken
    extends AbstractToken

    Access token (as well as any access token type-specific attributes) MUST be kept confidential in transit and storage, and only shared among the authorization server, the resource servers the access token is valid for, and the client to whom the access token is issued.

    When using the implicit grant type, the access token is transmitted in the URI fragment, which can expose it to unauthorized parties.

    The authorization server MUST ensure that access tokens cannot be generated, modified, or guessed to produce valid access tokens by unauthorized parties.

    The client SHOULD request access tokens with the minimal scope and lifetime necessary. The authorization server SHOULD take the client identity into account when choosing how to honor the requested scope and lifetime, and MAY issue an access token with a less rights than requested.

    Version:
    September 30, 2021
    Author:
    Javier Rojas Blum
    See Also:
    Serialized Form
    • Constructor Detail

      • AccessToken

        public AccessToken​(int lifeTime)

        Constructs an access token.

        When created, a token is valid for a given lifetime, and after this period of time, it will be marked as expired automatically by a background process.

        When required, the token can be marked as revoked.

        Parameters:
        lifeTime - The life time of the token.
      • AccessToken

        public AccessToken​(String tokenCode,
                           Date creationDate,
                           Date expirationDate)
    • Method Detail

      • getTokenType

        public io.jans.as.model.common.TokenType getTokenType()
        Returns the TokenType.
        Returns:
        The token type.
      • setTokenType

        public void setTokenType​(io.jans.as.model.common.TokenType tokenType)
        Sets the TokenType
        Parameters:
        tokenType - The token type.