---
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) &gt; [@loopback/authentication](./authentication.md) &gt; [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`


