Page Contents

Home > @loopback/authentication > TokenService > generateToken

TokenService.generateToken() method

Generates a token string based on a user profile

Signature:

generateToken(userProfile: UserProfile): Promise<string>;

Parameters

Parameter Type Description
userProfile UserProfile A UserProfile for which a token should be generated.

Returns:

Promise<string>

a generated token/secret for a given UserProfile.