Page Contents

Home > @loopback/authentication-passport > StrategyAdapter

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:

export declare class StrategyAdapter<U> implements AuthenticationStrategy 

Implements: AuthenticationStrategy

Constructors

Constructor Modifiers Description
[(constructor)(strategy, name, userProfileFactory)](/doc/en/lb4/apidocs.authentication-passport.strategyadapter._constructor_.html) Constructs a new instance of the `StrategyAdapter` class

Properties

Property Modifiers Type Description
[name](/doc/en/lb4/apidocs.authentication-passport.strategyadapter.name.html) `readonly` string

Methods

Method Modifiers Description
[authenticate(request, options)](/doc/en/lb4/apidocs.authentication-passport.strategyadapter.authenticate.html) 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