@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
62 lines (33 loc) • 1.49 kB
Markdown
---
lang: en
title: 'API docs: authentication-jwt.refreshtokenservice'
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.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)
## RefreshTokenService interface
The token refresh service. An access token expires in limited time. Therefore token refresh service is needed to keep replacing the old access token with a new one periodically.
**Signature:**
```typescript
export interface RefreshTokenService
```
## Methods
<table><thead><tr><th>
Method
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
[generateToken(userProfile, token)](./authentication-jwt.refreshtokenservice.generatetoken.md)
</td><td markdown="1">
Generate a refresh token, bind it with the given user profile + access token, then store them in backend.
</td></tr>
<tr><td markdown="1">
[refreshToken(refreshToken)](./authentication-jwt.refreshtokenservice.refreshtoken.md)
</td><td markdown="1">
Refresh the access token bound with the given refresh token.
</td></tr>
</tbody></table>