---
lang: en
title: 'API docs: authentication.tokenservice'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
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

<b>Signature:</b>

```typescript
export interface TokenService 
```

## Methods

|  Method | Description |
|  --- | --- |
|  [generateToken(userProfile)](./authentication.tokenservice.generatetoken.md) | Generates a token string based on a user profile |
|  [verifyToken(token)](./authentication.tokenservice.verifytoken.md) | Verifies the validity of a token string and returns a user profile |


