@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
37 lines (23 loc) • 1.1 kB
Markdown
---
lang: en
title: 'API docs: authentication.tokenservice.verifytoken'
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.verifytoken.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/authentication](./authentication.md) > [TokenService](./authentication.tokenservice.md) > [verifyToken](./authentication.tokenservice.verifytoken.md)
## TokenService.verifyToken() method
Verifies the validity of a token string and returns a user profile
<b>Signature:</b>
```typescript
verifyToken(token: string): Promise<UserProfile>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| token | string | The token/secret which should be validated/verified. |
<b>Returns:</b>
Promise<[UserProfile](./security.userprofile.md)<!-- -->>
The UserProfile which belongs to the given token.