1 | import { Logger } from "./Logger";
|
2 | import { TelemetryEmitter } from "./telemetry/TelemetryTypes";
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export declare type CacheLocation = "localStorage" | "sessionStorage";
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare type AuthOptions = {
|
23 | clientId: string;
|
24 | authority?: string;
|
25 | validateAuthority?: boolean;
|
26 | authorityMetadata?: string;
|
27 | knownAuthorities?: Array<string>;
|
28 | redirectUri?: string | (() => string);
|
29 | postLogoutRedirectUri?: string | (() => string);
|
30 | navigateToLoginRequestUrl?: boolean;
|
31 | };
|
32 | /**
|
33 | * Use this to configure the below cache configuration options:
|
34 | *
|
35 | * - cacheLocation - Used to specify the cacheLocation user wants to set. Valid values are "localStorage" and "sessionStorage"
|
36 | * - storeAuthStateInCookie - If set, MSAL store's the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.
|
37 | */
|
38 | export declare type CacheOptions = {
|
39 | cacheLocation?: CacheLocation;
|
40 | storeAuthStateInCookie?: boolean;
|
41 | };
|
42 | /**
|
43 | * Telemetry Config Options
|
44 | * - applicationName - Name of the consuming apps application
|
45 | * - applicationVersion - Verison of the consuming application
|
46 | * - telemetryEmitter - Function where telemetry events are flushed to
|
47 | */
|
48 | export declare type TelemetryOptions = {
|
49 | applicationName: string;
|
50 | applicationVersion: string;
|
51 | telemetryEmitter: TelemetryEmitter;
|
52 | };
|
53 | /**
|
54 | * Library Specific Options
|
55 | *
|
56 | * - logger - Used to initialize the Logger object; TODO: Expand on logger details or link to the documentation on logger
|
57 | * - loadFrameTimeout - maximum time the library should wait for a frame to load
|
58 | * - tokenRenewalOffsetSeconds - sets the window of offset needed to renew the token before expiry
|
59 | * - navigateFrameWait - sets the wait time for hidden iFrame navigation
|
60 | */
|
61 | export declare type SystemOptions = {
|
62 | logger?: Logger;
|
63 | loadFrameTimeout?: number;
|
64 | tokenRenewalOffsetSeconds?: number;
|
65 | navigateFrameWait?: number;
|
66 | telemetry?: TelemetryOptions;
|
67 | };
|
68 | /**
|
69 | * App/Framework specific environment support
|
70 | *
|
71 | * - isAngular - flag set to determine if it is Angular Framework. MSAL uses this to broadcast tokens. More to come here: detangle this dependency from core.
|
72 | * - unprotectedResources - Array of URI's which are unprotected resources. MSAL will not attach a token to outgoing requests that have these URI. Defaults to 'null'.
|
73 | * - protectedResourceMap - This is mapping of resources to scopes used by MSAL for automatically attaching access tokens in web API calls.A single access token is obtained for the resource. So you can map a specific resource path as follows: {"https://graph.microsoft.com/v1.0/me", ["user.read"]}, or the app URL of the resource as: {"https://graph.microsoft.com/", ["user.read", "mail.send"]}. This is required for CORS calls.
|
74 | *
|
75 | */
|
76 | export declare type FrameworkOptions = {
|
77 | isAngular?: boolean;
|
78 | unprotectedResources?: Array<string>;
|
79 | protectedResourceMap?: Map<string, Array<string>>;
|
80 | };
|
81 | /**
|
82 | * Use the configuration object to configure MSAL and initialize the UserAgentApplication.
|
83 | *
|
84 | * This object allows you to configure important elements of MSAL functionality:
|
85 | * - auth: this is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform
|
86 | * - cache: this is where you configure cache location and whether to store cache in cookies
|
87 | * - system: this is where you can configure the logger, frame timeout etc.
|
88 | * - framework: this is where you can configure the running mode of angular. More to come here soon.
|
89 | */
|
90 | export declare type Configuration = {
|
91 | auth: AuthOptions;
|
92 | cache?: CacheOptions;
|
93 | system?: SystemOptions;
|
94 | framework?: FrameworkOptions;
|
95 | };
|
96 | /**
|
97 | * MSAL function that sets the default options when not explicitly configured from app developer
|
98 | *
|
99 | * @param TAuthOptions
|
100 | * @param TCacheOptions
|
101 | * @param TSystemOptions
|
102 | * @param TFrameworkOptions
|
103 | * @param TAuthorityDataOptions
|
104 | *
|
105 | * @returns TConfiguration object
|
106 | */
|
107 | export declare function buildConfiguration({ auth, cache, system, framework }: Configuration): Configuration;
|
108 |
|
\ | No newline at end of file |