Package org.jivesoftware.openfire.auth
Class AuthToken
java.lang.Object
org.jivesoftware.openfire.auth.AuthToken
- Direct Known Subclasses:
AuthToken.OneTimeAuthToken
A token that proves that a user has successfully authenticated.
- Author:
- Matt Tucker
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A token that proves that a user uses a one time access token. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthToken
Constructs a new AuthToken that represents an authenticated, but anonymous user.static AuthToken
generateOneTimeToken
(String token) Constructs a new OneTimeAuthToken that represents an one time recovery user.static AuthToken
generateUserToken
(String username) Constructs a new AuthToken that represents an authenticated user identified by the provider username.Returns the username associated with this AuthToken.boolean
Returns true if this AuthToken is the Anonymous auth token.
-
Constructor Details
-
AuthToken
Constructs a new AuthToken with the specified username. The username can be either a simple username or a full JID.- Parameters:
jid
- the username or bare JID to create an authToken token with.
-
-
Method Details
-
generateUserToken
Constructs a new AuthToken that represents an authenticated user identified by the provider username.- Parameters:
username
- the username to create an authToken token with.- Returns:
- the auth token for the user
-
generateAnonymousToken
Constructs a new AuthToken that represents an authenticated, but anonymous user.- Returns:
- an anonymous auth token
-
generateOneTimeToken
Constructs a new OneTimeAuthToken that represents an one time recovery user.- Parameters:
token
- the one time token.- Returns:
- the newly generated auth token
-
getUsername
Returns the username associated with this AuthToken. Anull
value means that the authenticated user is anonymous.- Returns:
- the username associated with this AuthToken or null when using an anonymous user.
-
isAnonymous
public boolean isAnonymous()Returns true if this AuthToken is the Anonymous auth token.- Returns:
- true if this token is the anonymous AuthToken.
-