public class TokenAuthenticationResult extends Object
TokenAuthenticator.| Modifier and Type | Method and Description |
|---|---|
static TokenAuthenticationResult |
createAuthenticated(Collection<String> scopes,
Token token) |
static TokenAuthenticationResult |
createUnauthenticated(String reason)
Creates an unauthenticated result with a reason.
|
Principal |
getPrincipal()
The principal associated with the request.
|
Collection<String> |
getScopes()
The authentication scopes.
|
Token |
getToken()
The token that was checked for authentication.
|
String |
getUnauthenticatedReason()
If not authenticated, this returns the reason why as text.
|
boolean |
isAuthenticated() |
public static final TokenAuthenticationResult createUnauthenticated(String reason)
reason - the reason why the request is not authenticated.TokenAuthenticationResult.public static TokenAuthenticationResult createAuthenticated(Collection<String> scopes, Token token)
scopes - the authentication scopes. Can be empty.token - the token that was checked for authentication.TokenAuthenticationResult.@Nullable public Token getToken()
@Nullable public Principal getPrincipal()
public Collection<String> getScopes()
public boolean isAuthenticated()
public String getUnauthenticatedReason()
Copyright © 2020. All rights reserved.