UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

44 lines (29 loc) 1.95 kB
--- 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) &gt; [@loopback/authentication-passport](./authentication-passport.md) &gt; [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 <b>Signature:</b> ```typescript export declare class StrategyAdapter<U> implements AuthenticationStrategy ``` <b>Implements:</b> [AuthenticationStrategy](./authentication.authenticationstrategy.md) ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | | [(constructor)(strategy, name, userProfileFactory)](./authentication-passport.strategyadapter._constructor_.md) | | Constructs a new instance of the <code>StrategyAdapter</code> class | ## Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [name](./authentication-passport.strategyadapter.name.md) | | string | | ## Methods | Method | Modifiers | Description | | --- | --- | --- | | [authenticate(request, options)](./authentication-passport.strategyadapter.authenticate.md) | | 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 |