|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.security.authentication.server.AuthenticationToken
public class AuthenticationToken
The AuthenticationToken
contains information about an authenticated
HTTP client and doubles as the Principal
to be returned by
authenticated HttpServletRequest
s
AuthenticationFilter
).
Field Summary | |
---|---|
static AuthenticationToken |
ANONYMOUS
Constant that identifies an anonymous request. |
Constructor Summary | |
---|---|
AuthenticationToken(String userName,
String principal,
String type)
Creates an authentication token. |
Method Summary | |
---|---|
long |
getExpires()
Returns the expiration time of the token. |
String |
getName()
Returns the principal name (this method name comes from the JDK Principal interface). |
String |
getType()
Returns the authentication mechanism of the token. |
String |
getUserName()
Returns the user name. |
boolean |
isExpired()
Returns 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. |
String |
toString()
Returns the string representation of the token. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.security.Principal |
---|
equals, hashCode |
Field Detail |
---|
public static final AuthenticationToken ANONYMOUS
Constructor Detail |
---|
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
).Method Detail |
---|
public void setExpires(long expires)
expires
- expiration time of the token in milliseconds since the epoch.public String getUserName()
public String getName()
Principal
interface).
getName
in interface Principal
public String getType()
public long getExpires()
public boolean isExpired()
public String toString()
parse(java.lang.String)
method.
toString
in interface Principal
toString
in class Object
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |