Package eu.webtoolkit.jwt.auth
Class AuthTokenResult
java.lang.Object
eu.webtoolkit.jwt.auth.AuthTokenResult
The result of processing an authentication token.
An authentication token is usually taken from a browser cookie, and used to identify (and possibly authenticate) a user across sessions.
-
Constructor Summary
ConstructorDescriptionAuthTokenResult
(AuthTokenState state) Constructor.AuthTokenResult
(AuthTokenState state, User user) Constructor.AuthTokenResult
(AuthTokenState state, User user, String newToken) Constructor.AuthTokenResult
(AuthTokenState state, User user, String newToken, int newTokenValidity) Constructor. -
Method Summary
-
Constructor Details
-
AuthTokenResult
Constructor.Creates an authentication token result.
-
AuthTokenResult
Constructor. -
AuthTokenResult
Constructor. -
AuthTokenResult
Constructor.
-
-
Method Details
-
getState
Returns the result. -
getUser
Returns the identified user.The user is valid only if the the
getState()
==AuthTokenState.Valid
. -
getNewToken
Returns a new token for this user.Returns the empty string if there is no new token. See
AuthService.isAuthTokenUpdateEnabled()
.The returned token is valid only if the
getState()
==AuthTokenState.Valid
. -
getNewTokenValidity
public int getNewTokenValidity()Returns the validity of the new token.This returns the token validity in seconds.
Returns -1 if there is no new token, or result() != Valid.
- See Also:
-