Interface AccessToken


public interface AccessToken
An access token can be used to access scm-manager without providing username and password. An AccessToken can be issued from a restful webservice endpoint by providing credentials. After the token was issued, the token must be send along with every request. The token should be send in its compact representation as bearer authorization header or as cookie.
Since:
2.0.0
  • Method Details

    • getId

      String getId()
      Returns unique id of the access token.
    • getSubject

      String getSubject()
      Returns name of subject which identifies the principal.
    • getIssuer

      Optional<String> getIssuer()
      Returns optional issuer. The issuer identifies the principal that issued the token.
    • getIssuedAt

      Date getIssuedAt()
      Returns time at which the token was issued.
    • getExpiration

      Date getExpiration()
      Returns the expiration time of token.
    • getRefreshExpiration

      Optional<Date> getRefreshExpiration()
      Returns refresh expiration of token.
    • getParentKey

      Optional<String> getParentKey()
      Returns id of the parent key.
    • getScope

      Scope getScope()
      Returns the scope of the token. The scope is able to reduce the permissions of the subject in the context of this token. For example, we could issue a token which can only be used to read a single repository. for more informations please have a look at Scope.
    • getGroups

      Set<String> getGroups()
      Returns name of groups, in which the user should be a member.
    • getCustom

      <T> Optional<T> getCustom(String key)
      Returns an optional value of a custom token field.
      Type Parameters:
      T - type of field
      Parameters:
      key - key of token field
    • compact

      String compact()
      Returns compact representation of token.
    • getClaims

      Map<String,Object> getClaims()
      Returns read only map of all claim keys with their values.