| Modifier and Type | Field and Description |
|---|---|
static SaslRoleToken |
ANONYMOUS
Constant that identifies an anonymous request.
|
| Constructor and Description |
|---|
SaslRoleToken(String userRole,
String session)
Creates an authentication token.
|
SaslRoleToken(String userRole,
String session,
long expires) |
| Modifier and Type | Method and Description |
|---|---|
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 |
getSession()
Returns the authentication mechanism of the token.
|
String |
getUserRole()
Returns the user name.
|
boolean |
isExpired()
Returns if the token has expired.
|
static SaslRoleToken |
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.
|
public static final SaslRoleToken ANONYMOUS
public SaslRoleToken(String userRole, String session)
userRole - user name.session - the sessionId.
(System.currentTimeMillis() + validityPeriod).public void setExpires(long expires)
expires - expiration time of the token in milliseconds since the epoch.public String getUserRole()
public String getName()
Principal interface).public String getSession()
public long getExpires()
public boolean isExpired()
public String toString()
parse(java.lang.String) method.public static SaslRoleToken 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 © 2017–2021 Apache Software Foundation. All rights reserved.