@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
138 lines (66 loc) • 2.5 kB
Markdown
---
lang: en
title: 'API docs: authentication-passport.strategyadapter'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/authentication-passport
permalink: /doc/en/lb4/apidocs.authentication-passport.strategyadapter.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/authentication-passport](./authentication-passport.md) > [StrategyAdapter](./authentication-passport.strategyadapter.md)
## StrategyAdapter class
Adapter class to invoke passport-strategy 1. provides express dependencies to the passport strategies 2. provides shimming of requests for passport authentication 3. provides life-cycle similar to express to the passport-strategy 4. provides state methods to the strategy instance see: https://github.com/jaredhanson/passport
**Signature:**
```typescript
export declare class StrategyAdapter<U> implements AuthenticationStrategy
```
**Implements:** [AuthenticationStrategy](./authentication.authenticationstrategy.md)
## Constructors
<table><thead><tr><th>
Constructor
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
[(constructor)(strategy, name, userProfileFactory)](./authentication-passport.strategyadapter._constructor_.md)
</td><td markdown="1">
</td><td markdown="1">
Constructs a new instance of the `StrategyAdapter` class
</td></tr>
</tbody></table>
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
[name](./authentication-passport.strategyadapter.name.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
string
</td><td markdown="1">
</td></tr>
</tbody></table>
## Methods
<table><thead><tr><th>
Method
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
[authenticate(request, options)](./authentication-passport.strategyadapter.authenticate.md)
</td><td markdown="1">
</td><td markdown="1">
The function to invoke the contained passport strategy. 1. Create an instance of the strategy 2. add success and failure state handlers 3. authenticate using the strategy
</td></tr>
</tbody></table>