Package sonia.scm.security
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 Summary
Modifier and TypeMethodDescriptioncompact()
Returns compact representation of token.Returns read only map of all claim keys with their values.<T> Optional<T>
Returns an optional value of a custom token field.Returns the expiration time of token.Returns name of groups, in which the user should be a member.getId()
Returns unique id of the access token.Returns time at which the token was issued.Returns optional issuer.Returns id of the parent key.Returns refresh expiration of token.getScope()
Returns the scope of the token.Returns name of subject which identifies the principal.
-
Method Details
-
getId
String getId()Returns unique id of the access token. -
getSubject
String getSubject()Returns name of subject which identifies the principal. -
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
Returns refresh expiration of token. -
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 atScope
. -
getGroups
Returns name of groups, in which the user should be a member. -
getCustom
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
Returns read only map of all claim keys with their values.
-