Class AccessTokenInfo

    • Constructor Detail

      • AccessTokenInfo

        public AccessTokenInfo()
        The default constructor.
      • AccessTokenInfo

        public AccessTokenInfo​(String accessToken,
                               com.authlete.common.dto.IntrospectionResponse info)
        A constructor with an access token and a response from Authlete's /api/auth/introspection API.
        Parameters:
        accessToken - An access token.
        info - A response from Authlete's /api/auth/introspection API.
        Since:
        1.3
    • Method Detail

      • getAccessToken

        public String getAccessToken()
        Get the value of the access token.
        Returns:
        The value of the access token.
      • setAccessToken

        public AccessTokenInfo setAccessToken​(String accessToken)
        Set the value of the access token.
        Parameters:
        accessToken - The value of the access token.
        Returns:
        this object.
        Since:
        1.3
      • getClientId

        public long getClientId()
        Get the ID of the client application which is associated with the access token.
        Returns:
        The client ID.
      • setClientId

        public AccessTokenInfo setClientId​(long clientId)
        Set the ID of the client application which is associated with the access token.
        Parameters:
        clientId - The client ID.
        Returns:
        this object.
        Since:
        1.3
      • getSubject

        public String getSubject()
        Get the subject (= unique identifier) of the user who is associated with the access token. This method returns null if the access token was issued by Client Credentials Flow.
        Returns:
        The subject (= unique identifier) of the user.
      • setSubject

        public AccessTokenInfo setSubject​(String subject)
        Set the subject (= unique identifier) of the user who is associated with the access token.
        Parameters:
        subject - The subject (= unique identifier) of the user.
        Returns:
        this object.
        Since:
        1.3
      • getScopes

        public String[] getScopes()
        Get the scopes associated with the access token. This method returns null if no scope was requested when an access token was issued.
        Returns:
        The scopes.
      • setScopes

        public AccessTokenInfo setScopes​(String[] scopes)
        Set the scopes associated with the access token.
        Parameters:
        scopes - The scopes.
        Returns:
        this object.
        Since:
        1.3
      • getExpiresAt

        public long getExpiresAt()
        Get the time at which the access token will expire.
        Returns:
        The time at which the access token will expire. Milliseconds since the Unix epoch (1970-01-01).
      • setExpiresAt

        public AccessTokenInfo setExpiresAt​(long expiresAt)
        Set the time at which the access token will expire.
        Parameters:
        expiresAt - The time at which the access token will expire. Milliseconds since the Unix epoch (1970-01-01).
        Returns:
        this object.
        Since:
        1.3
      • getProperties

        public com.authlete.common.dto.Property[] getProperties()
        Get the extra properties associated with this access token.
        Returns:
        Extra properties. When no extra properties are associated with this access token, null is returned.
        Since:
        1.3
      • setProperties

        public AccessTokenInfo setProperties​(com.authlete.common.dto.Property[] properties)
        Set the extra properties associated with the access token.
        Parameters:
        properties - Extra properties.
        Returns:
        this object.
        Since:
        1.3