@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
36 lines (23 loc) • 1.22 kB
Markdown
lang: en
title: 'API docs: authentication-jwt.refreshtokenservice.generatetoken'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/authentication-jwt
permalink: /doc/en/lb4/apidocs.authentication-jwt.refreshtokenservice.generatetoken.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/authentication-jwt](./authentication-jwt.md) > [RefreshTokenService](./authentication-jwt.refreshtokenservice.md) > [generateToken](./authentication-jwt.refreshtokenservice.generatetoken.md)
## RefreshTokenService.generateToken() method
Generate a refresh token, bind it with the given user profile + access token, then store them in backend.
**Signature:**
```typescript
generateToken(userProfile: UserProfile, token: string): Promise<TokenObject>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| userProfile | [UserProfile](./security.userprofile.md) | |
| token | string | |
**Returns:**
Promise<[TokenObject](./authentication-jwt.tokenobject.md)<!-- -->>