Class CookieTokenService
java.lang.Object
org.exoplatform.web.security.security.AbstractTokenService<GateInToken,String>
org.exoplatform.web.security.security.CookieTokenService
- All Implemented Interfaces:
TokenStore,org.picocontainer.Startable
- Direct Known Subclasses:
RemindPasswordTokenService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String.static final Stringstatic final StringFields inherited from class org.exoplatform.web.security.security.AbstractTokenService
CLEANUP_PERIOD_TIME, DEFAULT_TOKEN_BYTE_LENGTH, delay_time, name, SERVICE_CONFIG, tokenByteLength, validityMillis -
Constructor Summary
ConstructorsConstructorDescriptionCookieTokenService(org.exoplatform.container.xml.InitParams initParams, GateInTokenStore tokenStore) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateToken(String username) Create a token and returns it.createToken(String username, String type) protected StringDecode a key from its string representation.voidRemoves all stored tokensdeleteToken(String cookieTokenString) deleteToken(String cookieTokenString, String tokenType) voiddeleteTokensByUsernameAndType(String username, String tokenType) The UI should offer a way to delete all existing tokens of the current user.voiddeleteTokensOfUser(String user) The UI should offer a way to delete all existing tokens of the current user.protected Stringlongsize()voidstart()Methods inherited from class org.exoplatform.web.security.security.AbstractTokenService
getInstance, getName, getPeriodTime, getValidityTime, nextRandom, stop, validateToken
-
Field Details
-
LIFECYCLE_NAME
.- See Also:
-
HASH_SERVICE_INIT_PARAM
- See Also:
-
ONBOARD_TOKEN
- See Also:
-
EMAIL_VALIDATION_TOKEN
- See Also:
-
FORGOT_PASSWORD_TOKEN
- See Also:
-
EXTERNAL_REGISTRATION_TOKEN
- See Also:
-
SEPARATOR_CHAR
- See Also:
-
-
Constructor Details
-
CookieTokenService
public CookieTokenService(org.exoplatform.container.xml.InitParams initParams, GateInTokenStore tokenStore) throws TokenServiceInitializationException
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable- Overrides:
startin classAbstractTokenService<GateInToken,String>
-
createToken
Description copied from interface:TokenStoreCreate 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
-
createToken
-
nextTokenId
- Overrides:
nextTokenIdin classAbstractTokenService<GateInToken,String>
-
getToken
- Specified by:
getTokenin classAbstractTokenService<GateInToken,String>
-
getToken
- Specified by:
getTokenin classAbstractTokenService<GateInToken,String>
-
deleteToken
- Specified by:
deleteTokenin classAbstractTokenService<GateInToken,String>
-
deleteToken
- Specified by:
deleteTokenin classAbstractTokenService<GateInToken,String>
-
deleteTokensOfUser
The UI should offer a way to delete all existing tokens of the current user.- Parameters:
user-
-
deleteTokensByUsernameAndType
The UI should offer a way to delete all existing tokens of the current user.- Parameters:
username- username Target usernametokenType- tokenType of the username
-
deleteAll
public void deleteAll()Removes all stored tokens -
cleanExpiredTokens
public void cleanExpiredTokens()- Specified by:
cleanExpiredTokensin classAbstractTokenService<GateInToken,String>
-
size
public long size()- Specified by:
sizein classAbstractTokenService<GateInToken,String>
-
decodeKey
Description copied from class:AbstractTokenServiceDecode a key from its string representation.- Specified by:
decodeKeyin classAbstractTokenService<GateInToken,String> - Parameters:
stringKey- the key a s a string- Returns:
- the typed key
-