Package auth.gui
Class AuthApiToken
- java.lang.Object
-
- auth.gui.AuthApiToken
-
- All Implemented Interfaces:
AuthAction.AuthMethod
@Singleton public class AuthApiToken extends java.lang.Object implements AuthAction.AuthMethod
Authentication via personal access tokens (API tokens) that can be used with JATOS API. API tokens are associated with a user and have the same access rights as the user. For a successful authentication, the token must be put in the 'Authorization' header with a 'Bearer' prefix. JATOS' API token has a prefex 'jap_'. TheUserand theApiTokenobjects are put in theRequestScopefor later use during request processing.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface auth.gui.AuthAction.AuthMethod
AuthAction.AuthMethod.AuthResult, AuthAction.AuthMethod.Type
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPI_TOKEN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthAction.AuthMethod.AuthResultauthenticate(play.mvc.Http.Request request, java.util.EnumSet<User.Role> allowedRoles)AuthAction.AuthMethod.Typetype()
-
-
-
Field Detail
-
API_TOKEN
public static final java.lang.String API_TOKEN
- See Also:
- Constant Field Values
-
-
Method Detail
-
type
public AuthAction.AuthMethod.Type type()
- Specified by:
typein interfaceAuthAction.AuthMethod
-
authenticate
public AuthAction.AuthMethod.AuthResult authenticate(play.mvc.Http.Request request, java.util.EnumSet<User.Role> allowedRoles)
- Specified by:
authenticatein interfaceAuthAction.AuthMethod- Parameters:
request- This action'sHttp.RequestobjectallowedRoles- Roles that are allowed to access the resource- Returns:
- Returns an
AuthAction.AuthMethod.AuthResult.
-
-