Class HMACApiTokenService
java.lang.Object
com.bluebell.greenhouse.radicle.security.services.impl.HMACApiTokenService
- All Implemented Interfaces:
ApiTokenService
@Service("hmacApiTokenService")
public class HMACApiTokenService
extends Object
implements ApiTokenService
Manages api tokens using the HMAC standard.
- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HMACApiTokenService
public HMACApiTokenService()
-
-
Method Details
-
generateApiToken
Generates a new api token for the givenUser.- Specified by:
generateApiTokenin interfaceApiTokenService- Parameters:
user-Usersecret- secrettimeToLive- time to live (in seconds)- Returns:
- api token
-
validateAndExtractUser
Validates the given api token as genuine and obtains theUserfor the token.- Specified by:
validateAndExtractUserin interfaceApiTokenService- Parameters:
token- api tokensecret- secret- Returns:
User
-