---
lang: en
title: 'API docs: authentication-jwt.jwtservice.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.jwtservice.generatetoken.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/authentication-jwt](./authentication-jwt.md) &gt; [JWTService](./authentication-jwt.jwtservice.md) &gt; [generateToken](./authentication-jwt.jwtservice.generatetoken.md)

## JWTService.generateToken() method

**Signature:**

```typescript
generateToken(userProfile: UserProfile): Promise<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  userProfile | [UserProfile](./security.userprofile.md) |  |

**Returns:**

Promise&lt;string&gt;


