public interface SecureUserTokenManager
The token and type can then be resolved back to that user.
Tokens provided by these implementations should be generated securly (i.e. using DefaultSecureTokenGenerator
) expire after 30 minutes and only be available for use
once!
Modifier and Type | Interface and Description |
---|---|
static class |
SecureUserTokenManager.TokenType
Token will be usable only for types of requests specified via this enum
|
Modifier and Type | Method and Description |
---|---|
String |
generateToken(ApplicationUser user,
SecureUserTokenManager.TokenType tokenType)
Given a user and tokentype this method creates a new secure token and returns this token.
|
ApplicationUser |
useToken(String token,
SecureUserTokenManager.TokenType tokenType)
Given a token and tokenType, this method returns the User that was mapped to this token and then revokes the
token to ensure it can't be used again.
|
String generateToken(ApplicationUser user, SecureUserTokenManager.TokenType tokenType)
user
- The user this token is fortokenType
- The SecureUserTokenManager.TokenType
for this tokenApplicationUser useToken(String token, SecureUserTokenManager.TokenType tokenType)
token
- A secure tokentokenType
- The SecureUserTokenManager.TokenType
for this tokenCopyright © 2002-2019 Atlassian. All Rights Reserved.