---
lang: en
title: 'API docs: authentication.tokenservice'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/authentication
permalink: /doc/en/lb4/apidocs.authentication.tokenservice.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/authentication](./authentication.md) &gt; [TokenService](./authentication.tokenservice.md)

## TokenService interface

An interface for generating and verifying a token

**Signature:**

```typescript
export interface TokenService 
```

## Methods

<table><thead><tr><th>

Method


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

[generateToken(userProfile)](./authentication.tokenservice.generatetoken.md)


</td><td markdown="1">

Generates a token string based on a user profile


</td></tr>
<tr><td markdown="1">

[revokeToken(token)?](./authentication.tokenservice.revoketoken.md)


</td><td markdown="1">

_(Optional)_ Revokes a given token (if supported by token system)


</td></tr>
<tr><td markdown="1">

[verifyToken(token)](./authentication.tokenservice.verifytoken.md)


</td><td markdown="1">

Verifies the validity of a token string and returns a user profile


</td></tr>
</tbody></table>


