@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 928 B
Markdown
lang: en
title: 'API docs: authentication.authenticate'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.authentication.authenticate.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/authentication](./authentication.md) > [authenticate](./authentication.authenticate.md)
## authenticate() function
Mark a controller method as requiring authenticated user.
<b>Signature:</b>
```typescript
export declare function authenticate(strategyName: string, options?: object): MethodDecorator;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| strategyName | <code>string</code> | The name of the authentication strategy to use. |
| options | <code>object</code> | Additional options to configure the authentication. |
<b>Returns:</b>
`MethodDecorator`