Package eu.webtoolkit.jwt.auth
Class AuthTokenResult
- java.lang.Object
-
- eu.webtoolkit.jwt.auth.AuthTokenResult
-
public class AuthTokenResult extends java.lang.ObjectThe 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
Constructors Constructor Description AuthTokenResult(AuthTokenState state)Constructor.AuthTokenResult(AuthTokenState state, User user)Constructor.AuthTokenResult(AuthTokenState state, User user, java.lang.String newToken)Constructor.AuthTokenResult(AuthTokenState state, User user, java.lang.String newToken, int newTokenValidity)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetNewToken()Returns a new token for this user.intgetNewTokenValidity()Returns the validity of the new token.AuthTokenStategetState()Returns the result.UsergetUser()Returns the identified user.
-
-
-
Constructor Detail
-
AuthTokenResult
public AuthTokenResult(AuthTokenState state, User user, java.lang.String newToken, int newTokenValidity)
Constructor.Creates an authentication token result.
-
AuthTokenResult
public AuthTokenResult(AuthTokenState state)
Constructor.
-
AuthTokenResult
public AuthTokenResult(AuthTokenState state, User user)
Constructor.
-
AuthTokenResult
public AuthTokenResult(AuthTokenState state, User user, java.lang.String newToken)
Constructor.
-
-
Method Detail
-
getState
public AuthTokenState getState()
Returns the result.
-
getUser
public User getUser()
Returns the identified user.The user is valid only if the the
getState()==AuthTokenState.Valid.
-
getNewToken
public java.lang.String 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:
getNewToken()
-
-