UNPKG

@loopback/docs

Version:
1,659 lines (1,156 loc) 39.9 kB
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/code-themes/sl-theme.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">docs.strongloop.com</a> </div> <div id="modules"></div> </div> <div class="row"> <div class="col-lg-3 column scroll-spy-target"> <ul class="nav nav-pills nav-stacked"> <div id="versions"></div> <li class="depth-3"> <a href="#AuthenticationComponent">Class: AuthenticationComponent</a> </li> <li class="depth-4"> <a href="#AuthenticationComponent.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#AuthenticationComponent.prototype.providers">providers</a> </li> <li class="depth-3"> <a href="#AuthenticationMetadata">Interface: AuthenticationMetadata</a> </li> <li class="depth-4"> <a href="#AuthenticationMetadata.prototype.options">options</a> </li> <li class="depth-4"> <a href="#AuthenticationMetadata.prototype.strategy">strategy</a> </li> <li class="depth-3"> <a href="#authenticate">authenticate()</a> </li> <li class="depth-3"> <a href="#getAuthenticateMetadata">getAuthenticateMetadata()</a> </li> <li class="depth-3"> <a href="#AuthenticationBindings">Namespace: AuthenticationBindings</a> </li> <li class="depth-4"> <a href="#AuthenticationBindings.AUTH_ACTION">AUTH_ACTION</a> </li> <li class="depth-4"> <a href="#AuthenticationBindings.CURRENT_USER">CURRENT_USER</a> </li> <li class="depth-4"> <a href="#AuthenticationBindings.METADATA">METADATA</a> </li> <li class="depth-4"> <a href="#AuthenticationBindings.STRATEGY">STRATEGY</a> </li> <li class="depth-3"> <a href="#AUTHENTICATION_METADATA_KEY">AUTHENTICATION_METADATA_KEY</a> </li> <li class="depth-3"> <a href="#AuthMetadataProvider">Class: AuthMetadataProvider</a> </li> <li class="depth-4"> <a href="#AuthMetadataProvider.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#AuthMetadataProvider.prototype.value">value()</a> </li> <li class="depth-3"> <a href="#AuthenticateActionProvider">Class: AuthenticateActionProvider</a> </li> <li class="depth-4"> <a href="#AuthenticateActionProvider.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#AuthenticateActionProvider.prototype.getStrategy">getStrategy</a> </li> <li class="depth-4"> <a href="#AuthenticateActionProvider.prototype.setCurrentUser">setCurrentUser</a> </li> <li class="depth-4"> <a href="#AuthenticateActionProvider.prototype.action">action()</a> </li> <li class="depth-4"> <a href="#AuthenticateActionProvider.prototype.value">value()</a> </li> <li class="depth-3"> <a href="#StrategyAdapter">Class: StrategyAdapter</a> </li> <li class="depth-4"> <a href="#StrategyAdapter.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#StrategyAdapter.prototype.authenticate">authenticate()</a> </li> <li class="depth-3"> <a href="#AuthenticateFn">Interface: AuthenticateFn</a> </li> <li class="depth-3"> <a href="#UserProfile">Interface: UserProfile</a> </li> <li class="depth-4"> <a href="#UserProfile.prototype.email">email</a> </li> <li class="depth-4"> <a href="#UserProfile.prototype.id">id</a> </li> <li class="depth-4"> <a href="#UserProfile.prototype.name">name</a> </li> </ul> </div> <div class="col-lg-9 col-lg-offset-3 column" data-spy="scroll" data-target=".scroll-spy-target" data-offset="0"> <div class="readability"> <section class="code-doc "> <a name="AuthenticationComponent"></a> <h3 class="code-ref">Class: authenticationcomponent = new AuthenticationComponent()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="AuthenticationComponent.prototype.providers"></a> <strong class="code-arg-name"> providers </strong> </td> <td class="code-arg-types"> <code><a href="#ProviderMap">ProviderMap</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported optional </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </td> </tr> </table> </section> <section class="code-doc "> <a name="AuthenticationComponent.constructor"></a> <h4 class="code-ref">constructor() : <a href="#AuthenticationComponent">AuthenticationComponent</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </section> <section class="code-doc "> <a name="AuthenticationMetadata"></a> <h3 class="code-ref">Interface: AuthenticationMetadata</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Authentication metadata stored via Reflection API</p> </p> <p></p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="AuthenticationMetadata.prototype.options"></a> <strong class="code-arg-name"> options </strong> </td> <td class="code-arg-types"> <code><a href="#Object">Object</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported optional </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Authentication metadata stored via Reflection API</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="AuthenticationMetadata.prototype.strategy"></a> <strong class="code-arg-name"> strategy </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Authentication metadata stored via Reflection API</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="authenticate"></a> <h3 class="code-ref">Function: authenticate</h3> <section class="code-doc "> <a name="authenticate"></a> <h4 class="code-ref">authenticate(strategyName: string, options: <a href="#Object">Object</a>) : anonymous</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Mark a controller method as requiring authenticated user.</p> </p> <p></p> </div> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> strategyName </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>The name of the authentication strategy to use.</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> options </strong> </td> <td class="code-arg-types"> <code><a href="#Object">Object</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> optional </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Additional options to configure the authentication.</p> </p> </div> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="getAuthenticateMetadata"></a> <h3 class="code-ref">Function: getAuthenticateMetadata</h3> <section class="code-doc "> <a name="getAuthenticateMetadata"></a> <h4 class="code-ref">getAuthenticateMetadata(controllerClass: <a href="#Constructor">Constructor</a>&lt;<a href="#__type">__type</a>&gt;, methodName: string) : <a href="#AuthenticationMetadata">AuthenticationMetadata</a> | undefined</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Fetch authentication metadata stored by <code>@authenticate</code> decorator.</p> </p> <p></p> </div> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> controllerClass </strong> </td> <td class="code-arg-types"> <code><a href="#Constructor">Constructor</a>&lt;<a href="#__type">__type</a>&gt;</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Target controller</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> methodName </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Target method</p> </p> </div> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="AuthenticationBindings"></a> <h3 class="code-ref">Namespace: AuthenticationBindings</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Binding keys used by this component.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="AuthenticationBindings.AUTH_ACTION"></a> <h3 class="code-ref">const AuthenticationBindings.AUTH_ACTION = BindingKey.create<AuthenticateFn>( 'authentication.actions.authenticate', )</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Key used to inject the authentication function into the sequence.</p> </p> <p><pre><code class="language-ts"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MySequence</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">SequenceHandler</span> </span>{ constructor( <span class="hljs-meta">@inject</span>(AuthenticationBindings.AUTH_ACTION) protected authenticateRequest: AuthenticateFn, <span class="hljs-comment">// ... other sequence action injections</span> ) {} <span class="hljs-keyword">async</span> handle(context: RequestContext) { <span class="hljs-keyword">try</span> { <span class="hljs-keyword">const</span> {request, response} = context; <span class="hljs-keyword">const</span> route = <span class="hljs-keyword">this</span>.findRoute(request); <span class="hljs-comment">// Authenticate</span> <span class="hljs-keyword">await</span> <span class="hljs-keyword">this</span>.authenticateRequest(request); <span class="hljs-comment">// Authentication successful, proceed to invoke controller</span> <span class="hljs-keyword">const</span> args = <span class="hljs-keyword">await</span> <span class="hljs-keyword">this</span>.parseParams(request, route); <span class="hljs-keyword">const</span> result = <span class="hljs-keyword">await</span> <span class="hljs-keyword">this</span>.invoke(route, args); <span class="hljs-keyword">this</span>.send(response, result); } <span class="hljs-keyword">catch</span> (err) { <span class="hljs-keyword">this</span>.reject(context, err); } } }</code></pre> </p> </div> </section> <section class="code-doc "> <a name="AuthenticationBindings.CURRENT_USER"></a> <h3 class="code-ref">const AuthenticationBindings.CURRENT_USER = BindingKey.create<UserProfile | undefined>( 'authentication.currentUser', )</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Key used to inject the user instance retrieved by the authentication function</p> </p> <p><p>class MyController { constructor( @inject(AuthenticationBindings.CURRENT_USER) private user: UserProfile, ) {}</p> <p>// ... routes that may need authentication }</p> </p> </div> </section> <section class="code-doc "> <a name="AuthenticationBindings.METADATA"></a> <h3 class="code-ref">const AuthenticationBindings.METADATA = BindingKey.create<AuthenticationMetadata | undefined>( 'authentication.operationMetadata', )</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Key used to inject authentication metadata, which is used to determine whether a request requires authentication or not.</p> </p> <p><pre><code class="language-ts"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyPassportStrategyProvider</span> <span class="hljs-title">implements</span> <span class="hljs-title">Provider</span>&lt;<span class="hljs-type">Strategy | undefined</span>&gt; </span>{ <span class="hljs-keyword">constructor</span>( <span class="hljs-meta">@inject(AuthenticationBindings.METADATA)</span> <span class="hljs-keyword">private</span> metadata: AuthenticationMetadata, ) {} value(): ValueOrPromise&lt;Strategy | undefined&gt; { <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.metadata) { const name = <span class="hljs-keyword">this</span>.metadata.strategy; <span class="hljs-comment">// logic to determine which authentication strategy to return</span> } } }</code></pre> </p> </div> </section> <section class="code-doc "> <a name="AuthenticationBindings.STRATEGY"></a> <h3 class="code-ref">const AuthenticationBindings.STRATEGY = BindingKey.create<Strategy | undefined>( 'authentication.strategy', )</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Key used to bind an authentication strategy to the context for the authentication function to use.</p> </p> <p><pre><code class="language-ts"><span class="hljs-selector-tag">server</span> <span class="hljs-selector-class">.bind</span>(<span class="hljs-selector-tag">AuthenticationBindings</span><span class="hljs-selector-class">.STRATEGY</span>) <span class="hljs-selector-class">.toProvider</span>(<span class="hljs-selector-tag">MyPassportStrategyProvider</span>);</code></pre> </p> </div> </section> <section class="code-doc "> <a name="AUTHENTICATION_METADATA_KEY"></a> <h3 class="code-ref">const AUTHENTICATION_METADATA_KEY = MetadataAccessor.create< AuthenticationMetadata >('authentication.operationsMetadata')</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>The key used to store log-related via @loopback/metadata and reflection.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="AuthMetadataProvider"></a> <h3 class="code-ref">Class: authmetadataprovider = new AuthMetadataProvider()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </section> <section class="code-doc "> <a name="AuthMetadataProvider.constructor"></a> <h4 class="code-ref">constructor(controllerClass: <a href="#Constructor">Constructor</a>&lt;<a href="#__type">__type</a>&gt;, methodName: string) : <a href="#AuthMetadataProvider">AuthMetadataProvider</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> controllerClass </strong> </td> <td class="code-arg-types"> <code><a href="#Constructor">Constructor</a>&lt;<a href="#__type">__type</a>&gt;</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> methodName </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="AuthMetadataProvider.prototype.value"></a> <h4 class="code-ref">value() : <a href="#AuthenticationMetadata">AuthenticationMetadata</a> | undefined</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> Returns: <p><p>AuthenticationMetadata</p> </p> </section> <section class="code-doc "> <a name="AuthenticateActionProvider"></a> <h3 class="code-ref">Class: authenticateactionprovider = new AuthenticateActionProvider()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="AuthenticateActionProvider.prototype.getStrategy"></a> <strong class="code-arg-name"> getStrategy </strong> </td> <td class="code-arg-types"> <code><a href="#Getter">Getter</a>&lt;<a href="#Strategy">Strategy</a>&gt;</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> constructorProperty exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="AuthenticateActionProvider.prototype.setCurrentUser"></a> <strong class="code-arg-name"> setCurrentUser </strong> </td> <td class="code-arg-types"> <code><a href="#Setter">Setter</a>&lt;<a href="#UserProfile">UserProfile</a>&gt;</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> constructorProperty exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="AuthenticateActionProvider.constructor"></a> <h4 class="code-ref">constructor(getStrategy: <a href="#Getter">Getter</a>&lt;<a href="#Strategy">Strategy</a>&gt;, setCurrentUser: <a href="#Setter">Setter</a>&lt;<a href="#UserProfile">UserProfile</a>&gt;) : <a href="#AuthenticateActionProvider">AuthenticateActionProvider</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> getStrategy </strong> </td> <td class="code-arg-types"> <code><a href="#Getter">Getter</a>&lt;<a href="#Strategy">Strategy</a>&gt;</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> setCurrentUser </strong> </td> <td class="code-arg-types"> <code><a href="#Setter">Setter</a>&lt;<a href="#UserProfile">UserProfile</a>&gt;</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="AuthenticateActionProvider.prototype.action"></a> <h4 class="code-ref">action(request: <a href="#Request">Request</a>) : <a href="#Promise">Promise</a>&lt;<a href="#UserProfile">UserProfile</a> | undefined&gt;</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>The implementation of authenticate() sequence action.</p> </p> <p></p> </div> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> request </strong> </td> <td class="code-arg-types"> <code><a href="#Request">Request</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>The incoming request provided by the REST layer</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="AuthenticateActionProvider.prototype.value"></a> <h4 class="code-ref">value() : <a href="#AuthenticateFn">AuthenticateFn</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> Returns: <p><p>authenticateFn</p> </p> </section> <section class="code-doc "> <a name="StrategyAdapter"></a> <h3 class="code-ref">Class: strategyadapter = new StrategyAdapter()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Adapter class to invoke passport-strategy</p> <ol> <li>provides express dependencies to the passport strategies</li> <li>provides shimming of requests for passport authentication</li> <li>provides lifecycle similar to express to the passport-strategy</li> <li>provides state methods to the strategy instance see: <a href="https://github.com/jaredhanson/passport">https://github.com/jaredhanson/passport</a></li> </ol> </p> <p></p> </div> </section> <section class="code-doc "> <a name="StrategyAdapter.constructor"></a> <h4 class="code-ref">constructor(strategy: <a href="#Strategy">Strategy</a>) : <a href="#StrategyAdapter">StrategyAdapter</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> strategy </strong> </td> <td class="code-arg-types"> <code><a href="#Strategy">Strategy</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>instance of a class which implements a passport-strategy;</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="StrategyAdapter.prototype.authenticate"></a> <h4 class="code-ref">authenticate(request: <a href="#Request">Request</a>) : <a href="#Promise">Promise</a>&lt;<a href="#UserProfile">UserProfile</a>&gt;</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>The function to invoke the contained passport strategy.</p> <pre><code>1. Create an<span class="hljs-built_in"> instance </span>of the strategy 2. <span class="hljs-builtin-name">add</span> success <span class="hljs-keyword">and</span> failure state handlers 3. authenticate using the strategy</code></pre></p> <p></p> </div> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> request </strong> </td> <td class="code-arg-types"> <code><a href="#Request">Request</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>The incoming request.</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="AuthenticateFn"></a> <h3 class="code-ref">Interface: AuthenticateFn</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>interface definition of a function which accepts a request and returns an authenticated user</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="UserProfile"></a> <h3 class="code-ref">Interface: UserProfile</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>interface definition of a user profile <a href="http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims">http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims</a></p> </p> <p></p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="UserProfile.prototype.email"></a> <strong class="code-arg-name"> email </strong> </td> <td class="code-arg-types"> <code>undefined | string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported optional </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>interface definition of a user profile <a href="http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims">http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims</a></p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="UserProfile.prototype.id"></a> <strong class="code-arg-name"> id </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>interface definition of a user profile <a href="http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims">http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims</a></p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="UserProfile.prototype.name"></a> <strong class="code-arg-name"> name </strong> </td> <td class="code-arg-types"> <code>undefined | string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported optional </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>interface definition of a user profile <a href="http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims">http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims</a></p> </p> <p></p> </div> </td> </tr> </table> </section> </div> <div class="intentionally-left-blank"></div> </div> </div> <script src="js/vendor/jquery-1.10.1.min.js"></script> <script src="js/vendor/jquery.scrollTo-1.4.3.1.js"></script> <script src="js/vendor/bootstrap.min.js"></script> <script src="js/main.js"></script> </body> </html>