Page Contents
Home > @loopback/authentication > TokenService
TokenService interface
An interface for generating and verifying a token
Signature:
export interface TokenService
Methods
| Method | Description |
|---|---|
| [generateToken(userProfile)](/doc/en/lb4/apidocs.authentication.tokenservice.generatetoken.html) | Generates a token string based on a user profile |
| [revokeToken(token)?](/doc/en/lb4/apidocs.authentication.tokenservice.revoketoken.html) | _(Optional)_ Revokes a given token (if supported by token system) |
| [verifyToken(token)](/doc/en/lb4/apidocs.authentication.tokenservice.verifytoken.html) | Verifies the validity of a token string and returns a user profile |