Package org.exoplatform.web.security
Interface TokenStore
- All Known Implementing Classes:
AbstractTokenService,CookieTokenService,PlainTokenService,RemindPasswordTokenService,TransientTokenService
public interface TokenStore
The token store is a place where temporary tokens are held.
-
Method Summary
Modifier and TypeMethodDescriptioncreateToken(String username) Create a token and returns it.validateToken(String tokenKey, boolean remove) Validates a token.
-
Method Details
-
createToken
Create a token and returns it. The store state is modified as it retains the token until it is removed either explicitely or because the token validity is expired.- Parameters:
username- the username related to the token- Returns:
- the token key
- Throws:
IllegalArgumentException- if the validity is not greater than zeroNullPointerException- if the payload is null
-
validateToken
Validates a token. If the token is valid it returns the attached credentials. The store state may be modified by the removal of the token. The token is removed either if the remove argument is set to true of if the token is not anymore valid.- Parameters:
tokenKey- the token keyremove- true if the token must be removed regardless its validity- Returns:
- the attached credentials or null
- Throws:
NullPointerException- if the token key argument is null
-