Class UserApiToken


  • public class UserApiToken
    extends Object
    An API token represents long-term credentials generated by (or for) a user, giving the bearer access for a certain scope on behalf of this user.
    Author:
    Yannick Schaus - initial contribution
    • Constructor Detail

      • UserApiToken

        public UserApiToken​(String name,
                            String apiToken,
                            String scope)
        Constructs an API token.
        Parameters:
        name - the name of the token, for identification purposes
        apiToken - the serialization of the token
        scope - the scope this token is valid for
    • Method Detail

      • getName

        public String getName()
        Gets the name identifying the token
        Returns:
        the API token
      • getApiToken

        public String getApiToken()
        Get the serialization of the opaque API token which can be passed in requests as a "Bearer" token in the Authorization HTTP header.
        Returns:
        the API token
      • getCreatedTime

        public Date getCreatedTime()
        Gets the time when this token was created.
        Returns:
        the date of creation
      • getScope

        public String getScope()
        Gets the scope this token is valid for.
        Returns:
        the scope