Package eu.webtoolkit.jwt.auth
Class AuthTokenResult
java.lang.Object
eu.webtoolkit.jwt.auth.AuthTokenResult
public class AuthTokenResult
extends java.lang.Object
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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthTokenResult.Result
Enumeration that describes the result. -
Constructor Summary
Constructors Constructor Description AuthTokenResult(AuthTokenResult.Result result)
Constructor.AuthTokenResult(AuthTokenResult.Result result, User user)
Constructor.AuthTokenResult(AuthTokenResult.Result result, User user, java.lang.String newToken)
Constructor.AuthTokenResult(AuthTokenResult.Result result, User user, java.lang.String newToken, int newTokenValidity)
Constructor. -
Method Summary
Modifier and Type Method Description java.lang.String
getNewToken()
Returns a new token for this user.int
getNewTokenValidity()
Returns the validity of the new token.AuthTokenResult.Result
getResult()
Returns the result.User
getUser()
Returns the identified user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AuthTokenResult
public AuthTokenResult(AuthTokenResult.Result result, User user, java.lang.String newToken, int newTokenValidity)Constructor.Creates an authentication token result.
-
AuthTokenResult
Constructor. -
AuthTokenResult
Constructor. -
AuthTokenResult
Constructor.
-
-
Method Details
-
getResult
Returns the result. -
getUser
Returns the identified user.The user is valid only if the the
getResult()
== 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
getResult()
== 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
getResult()
!= Valid.- See Also:
getNewToken()
-