UNPKG

1.84 kBTypeScriptView Raw
1/**
2 * -------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4 * See License in the project root for license information.
5 * -------------------------------------------------------------------------------------------
6 */
7import { AuthenticationProvider } from "../IAuthenticationProvider";
8import { Context } from "../IContext";
9import { Middleware } from "./IMiddleware";
10/**
11 * @class
12 * @implements Middleware
13 * Class representing AuthenticationHandler
14 */
15export declare class AuthenticationHandler implements Middleware {
16 /**
17 * @private
18 * A member representing the authorization header name
19 */
20 private static AUTHORIZATION_HEADER;
21 /**
22 * @private
23 * A member to hold an AuthenticationProvider instance
24 */
25 private authenticationProvider;
26 /**
27 * @private
28 * A member to hold next middleware in the middleware chain
29 */
30 private nextMiddleware;
31 /**
32 * @public
33 * @constructor
34 * Creates an instance of AuthenticationHandler
35 * @param {AuthenticationProvider} authenticationProvider - The authentication provider for the authentication handler
36 */
37 constructor(authenticationProvider: AuthenticationProvider);
38 /**
39 * @public
40 * @async
41 * To execute the current middleware
42 * @param {Context} context - The context object of the request
43 * @returns A Promise that resolves to nothing
44 */
45 execute(context: Context): Promise<void>;
46 /**
47 * @public
48 * To set the next middleware in the chain
49 * @param {Middleware} next - The middleware instance
50 * @returns Nothing
51 */
52 setNext(next: Middleware): void;
53}