public class AuthenticationToken extends AuthToken
AuthenticationToken contains information about an authenticated
 HTTP client and doubles as the Principal to be returned by
 authenticated HttpServletRequests
 
 The token can be serialized/deserialized to and from a string as it is sent
 and received in HTTP client responses and requests as a HTTP cookie (this is
 done by the AuthenticationFilter).
| Modifier and Type | Field and Description | 
|---|---|
| static AuthenticationToken | ANONYMOUSConstant that identifies an anonymous request. | 
| Constructor and Description | 
|---|
| AuthenticationToken(String userName,
                   String principal,
                   String type)Creates an authentication token. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | isExpired()Returns true if the token has expired. | 
| static AuthenticationToken | parse(String tokenStr)Parses a string into an authentication token. | 
| void | setExpires(long expires)Sets the expiration of the token. | 
| void | setMaxInactives(long maxInactives)Sets the max inactive time of the token. | 
checkForIllegalArgument, getExpires, getMaxInactives, getName, getType, getUserName, toStringpublic static final AuthenticationToken ANONYMOUS
public AuthenticationToken(String userName, String principal, String type)
userName - user name.principal - principal (commonly matches the user name, with Kerberos is the full/long principal
 name while the userName is the short name).type - the authentication mechanism name.
 (System.currentTimeMillis() + validityPeriod).public void setMaxInactives(long maxInactives)
setMaxInactives in class AuthTokenmaxInactives - inactive time of the token in milliseconds
                     since the epoch.public void setExpires(long expires)
setExpires in class AuthTokenexpires - expiration time of the token in milliseconds since the epoch.public boolean isExpired()
public static AuthenticationToken parse(String tokenStr) throws AuthenticationException
tokenStr - string representation of a token.AuthenticationException - thrown if the string representation could not be parsed into
 an authentication token.Copyright © 2008–2023 Apache Software Foundation. All rights reserved.