Class: authenticationcomponent = new AuthenticationComponent()

Properties
Name Type Description
providers ProviderMap

constructor() : AuthenticationComponent

Interface: AuthenticationMetadata

Authentication metadata stored via Reflection API

Properties
Name Type Description
options Object

Authentication metadata stored via Reflection API

strategy string

Authentication metadata stored via Reflection API

Function: authenticate

authenticate(strategyName: string, options: Object) :

Mark a controller method as requiring authenticated user.

Arguments
Name Type Description
strategyName string

The name of the authentication strategy to use.

options Object

Additional options to configure the authentication.

Function: getAuthenticateMetadata

getAuthenticateMetadata(controllerClass: Constructor, methodName: string) : AuthenticationMetadata | undefined

Fetch authentication metadata stored by @authenticate decorator.

Arguments
Name Type Description
controllerClass Constructor

Target controller

methodName string

Target method

Class: authmetadataprovider = new AuthMetadataProvider()

constructor(controllerClass: Constructor, methodName: string) : AuthMetadataProvider

Arguments
Name Type Description
controllerClass Constructor

methodName string

value() : AuthenticationMetadata | undefined

Returns:

AuthenticationMetadata

Class: authenticateactionprovider = new AuthenticateActionProvider()

Properties
Name Type Description
getStrategy Getter

setCurrentUser Setter

constructor(getStrategy: Getter, setCurrentUser: Setter) : AuthenticateActionProvider

Arguments
Name Type Description
getStrategy Getter

setCurrentUser Setter

action(request: ParsedRequest) : Promise

The implementation of authenticate() sequence action.

Arguments
Name Type Description
request ParsedRequest

Parsed Request

value() : AuthenticateFn

Returns:

authenticateFn

Interface: AuthenticateFn

interface definition of a function which accepts a request and returns an authenticated user

Interface: UserProfile

Properties
Name Type Description
email
id string
name

Class: shimrequest = new ShimRequest()

Shimmed Request to satisfy express requirements of passport strategies.

Properties
Name Type Description
headers Object

Shimmed Request to satisfy express requirements of passport strategies.

method string

Shimmed Request to satisfy express requirements of passport strategies.

path string

Shimmed Request to satisfy express requirements of passport strategies.

query Object

Shimmed Request to satisfy express requirements of passport strategies.

url string

Shimmed Request to satisfy express requirements of passport strategies.

constructor(request: ParsedRequest) : ShimRequest

Arguments
Name Type Description
request ParsedRequest

Shimmed Request to satisfy express requirements of passport strategies.

isAuthenticated() : boolean

isUnauthenticated() : boolean

logIn(user: any, done: (err: any) => void) : void

Arguments
Name Type Description
user any

Shimmed Request to satisfy express requirements of passport strategies.

done Function

Shimmed Request to satisfy express requirements of passport strategies.

logIn(user: any, options: any, done: (err: any) => void) : void

Arguments
Name Type Description
user any

Shimmed Request to satisfy express requirements of passport strategies.

options any

Shimmed Request to satisfy express requirements of passport strategies.

done Function

Shimmed Request to satisfy express requirements of passport strategies.

logOut() : void

login(user: any, done: (err: any) => void) : void

Arguments
Name Type Description
user any

Shimmed Request to satisfy express requirements of passport strategies.

done Function

Shimmed Request to satisfy express requirements of passport strategies.

login(user: any, options: any, done: (err: any) => void) : void

Arguments
Name Type Description
user any

Shimmed Request to satisfy express requirements of passport strategies.

options any

Shimmed Request to satisfy express requirements of passport strategies.

done Function

Shimmed Request to satisfy express requirements of passport strategies.

logout() : void

Class: strategyadapter = new StrategyAdapter()

Adapter class to invoke passport-strategy

  1. provides express dependencies to the passport strategies
  2. provides shimming of requests for passport authentication
  3. provides lifecycle similar to express to the passport-strategy
  4. provides state methods to the strategy instance see: https://github.com/jaredhanson/passport

constructor(strategy: Strategy) : StrategyAdapter

Arguments
Name Type Description
strategy Strategy

instance of a class which implements a passport-strategy;

authenticate(req: ParsedRequest) : Promise

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

Arguments
Name Type Description
req ParsedRequest

The incoming request.