@azure/msal-browser 3.20.0 → 3.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.d.ts +53 -53
- package/dist/app/IPublicClientApplication.mjs +105 -105
- package/dist/app/PublicClientApplication.d.ts +293 -293
- package/dist/app/PublicClientApplication.mjs +364 -364
- package/dist/app/PublicClientNext.d.ts +276 -276
- package/dist/app/PublicClientNext.mjs +354 -354
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +62 -62
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +254 -254
- package/dist/broker/nativeBroker/NativeRequest.d.ts +45 -45
- package/dist/broker/nativeBroker/NativeResponse.d.ts +48 -48
- package/dist/broker/nativeBroker/NativeStatusCodes.d.ts +7 -7
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +11 -11
- package/dist/cache/AccountManager.d.ts +48 -48
- package/dist/cache/AccountManager.mjs +126 -126
- package/dist/cache/AsyncMemoryStorage.d.ts +50 -50
- package/dist/cache/AsyncMemoryStorage.mjs +131 -131
- package/dist/cache/BrowserCacheManager.d.ts +410 -385
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1364 -1294
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.d.ts +11 -11
- package/dist/cache/BrowserStorage.mjs +32 -32
- package/dist/cache/DatabaseStorage.d.ts +56 -56
- package/dist/cache/DatabaseStorage.mjs +200 -200
- package/dist/cache/IAsyncStorage.d.ts +27 -27
- package/dist/cache/ITokenCache.d.ts +11 -11
- package/dist/cache/IWindowStorage.d.ts +27 -27
- package/dist/cache/MemoryStorage.d.ts +11 -11
- package/dist/cache/MemoryStorage.mjs +31 -31
- package/dist/cache/TokenCache.d.ts +77 -77
- package/dist/cache/TokenCache.mjs +195 -195
- package/dist/config/Configuration.d.ts +213 -208
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +128 -128
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.d.ts +5 -5
- package/dist/controllers/ControllerFactory.mjs +25 -25
- package/dist/controllers/IController.d.ts +60 -60
- package/dist/controllers/NestedAppAuthController.d.ts +202 -202
- package/dist/controllers/NestedAppAuthController.mjs +473 -473
- package/dist/controllers/StandardController.d.ts +405 -405
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +1334 -1316
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +86 -86
- package/dist/controllers/UnknownOperatingContextController.mjs +256 -256
- package/dist/crypto/BrowserCrypto.d.ts +52 -52
- package/dist/crypto/BrowserCrypto.mjs +151 -151
- package/dist/crypto/CryptoOps.d.ts +74 -74
- package/dist/crypto/CryptoOps.mjs +176 -176
- package/dist/crypto/PkceGenerator.d.ts +8 -8
- package/dist/crypto/PkceGenerator.mjs +54 -54
- package/dist/crypto/SignedHttpRequest.d.ts +30 -30
- package/dist/crypto/SignedHttpRequest.mjs +39 -39
- package/dist/encode/Base64Decode.d.ts +9 -9
- package/dist/encode/Base64Decode.mjs +36 -36
- package/dist/encode/Base64Encode.d.ts +19 -19
- package/dist/encode/Base64Encode.mjs +43 -43
- package/dist/error/BrowserAuthError.d.ts +256 -255
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.mjs +265 -264
- package/dist/error/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.d.ts +47 -46
- package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +53 -52
- package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.d.ts +33 -33
- package/dist/error/BrowserConfigurationAuthError.mjs +40 -40
- package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts +3 -3
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +7 -7
- package/dist/error/NativeAuthError.d.ts +29 -29
- package/dist/error/NativeAuthError.mjs +60 -60
- package/dist/error/NativeAuthErrorCodes.d.ts +2 -2
- package/dist/error/NativeAuthErrorCodes.mjs +6 -6
- package/dist/error/NestedAppAuthError.d.ts +14 -14
- package/dist/error/NestedAppAuthError.mjs +23 -23
- package/dist/event/EventHandler.d.ts +41 -41
- package/dist/event/EventHandler.mjs +125 -125
- package/dist/event/EventMessage.d.ts +25 -25
- package/dist/event/EventMessage.mjs +68 -68
- package/dist/event/EventType.d.ts +29 -29
- package/dist/event/EventType.mjs +32 -32
- package/dist/index.d.ts +40 -40
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +50 -50
- package/dist/interaction_client/BaseInteractionClient.mjs +106 -106
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +4 -4
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +10 -10
- package/dist/interaction_client/NativeInteractionClient.d.ts +151 -151
- package/dist/interaction_client/NativeInteractionClient.mjs +621 -621
- package/dist/interaction_client/PopupClient.d.ts +118 -105
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +460 -434
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +50 -50
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +349 -317
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +23 -23
- package/dist/interaction_client/SilentAuthCodeClient.mjs +57 -57
- package/dist/interaction_client/SilentCacheClient.d.ts +16 -16
- package/dist/interaction_client/SilentCacheClient.mjs +42 -42
- package/dist/interaction_client/SilentIframeClient.d.ts +32 -32
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +111 -101
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts +20 -20
- package/dist/interaction_client/SilentRefreshClient.mjs +47 -47
- package/dist/interaction_client/StandardInteractionClient.d.ts +48 -48
- package/dist/interaction_client/StandardInteractionClient.mjs +199 -199
- package/dist/interaction_handler/InteractionHandler.d.ts +33 -33
- package/dist/interaction_handler/InteractionHandler.mjs +93 -93
- package/dist/interaction_handler/RedirectHandler.d.ts +32 -32
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +135 -134
- package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +13 -13
- package/dist/interaction_handler/SilentHandler.mjs +134 -134
- package/dist/naa/AccountInfo.d.ts +11 -11
- package/dist/naa/AuthBridge.d.ts +8 -8
- package/dist/naa/AuthResult.d.ts +6 -6
- package/dist/naa/BridgeAccountContext.d.ts +12 -12
- package/dist/naa/BridgeCapabilities.d.ts +3 -3
- package/dist/naa/BridgeError.d.ts +9 -9
- package/dist/naa/BridgeError.mjs +7 -7
- package/dist/naa/BridgeProxy.d.ts +67 -67
- package/dist/naa/BridgeProxy.d.ts.map +1 -1
- package/dist/naa/BridgeProxy.mjs +153 -148
- package/dist/naa/BridgeProxy.mjs.map +1 -1
- package/dist/naa/BridgeRequest.d.ts +7 -7
- package/dist/naa/BridgeRequestEnvelope.d.ts +12 -12
- package/dist/naa/BridgeResponseEnvelope.d.ts +13 -13
- package/dist/naa/BridgeStatusCode.d.ts +11 -11
- package/dist/naa/BridgeStatusCode.mjs +14 -14
- package/dist/naa/IBridgeProxy.d.ts +10 -10
- package/dist/naa/InitContext.d.ts +8 -8
- package/dist/naa/TokenRequest.d.ts +18 -18
- package/dist/naa/TokenResponse.d.ts +13 -13
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts +35 -35
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +179 -179
- package/dist/navigation/INavigationClient.d.ts +16 -16
- package/dist/navigation/NavigationClient.d.ts +22 -22
- package/dist/navigation/NavigationClient.mjs +40 -40
- package/dist/navigation/NavigationOptions.d.ts +12 -12
- package/dist/network/FetchClient.d.ts +26 -26
- package/dist/network/FetchClient.mjs +99 -99
- package/dist/operatingcontext/BaseOperatingContext.d.ts +41 -41
- package/dist/operatingcontext/BaseOperatingContext.mjs +94 -94
- package/dist/operatingcontext/NestedAppOperatingContext.d.ts +34 -34
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +71 -71
- package/dist/operatingcontext/StandardOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/StandardOperatingContext.mjs +43 -43
- package/dist/operatingcontext/UnknownOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/UnknownOperatingContext.mjs +42 -42
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.mjs +4 -4
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -8
- package/dist/request/AuthorizationUrlRequest.d.ts +8 -8
- package/dist/request/ClearCacheRequest.d.ts +10 -10
- package/dist/request/EndSessionPopupRequest.d.ts +18 -18
- package/dist/request/EndSessionRequest.d.ts +15 -15
- package/dist/request/InitializeApplicationRequest.d.ts +8 -8
- package/dist/request/PopupRequest.d.ts +34 -34
- package/dist/request/PopupWindowAttributes.d.ts +15 -15
- package/dist/request/RedirectRequest.d.ts +40 -35
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/RequestHelpers.d.ts +13 -13
- package/dist/request/RequestHelpers.mjs +53 -53
- package/dist/request/SilentRequest.d.ts +33 -33
- package/dist/request/SsoSilentRequest.d.ts +29 -29
- package/dist/response/AuthenticationResult.d.ts +4 -4
- package/dist/response/ResponseHandler.d.ts +7 -7
- package/dist/response/ResponseHandler.mjs +36 -36
- package/dist/telemetry/BrowserPerformanceClient.d.ts +38 -34
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +163 -163
- package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +21 -21
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +92 -92
- package/dist/utils/BrowserConstants.d.ts +182 -180
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.mjs +214 -212
- package/dist/utils/BrowserConstants.mjs.map +1 -1
- package/dist/utils/BrowserProtocolUtils.d.ts +11 -11
- package/dist/utils/BrowserProtocolUtils.mjs +21 -21
- package/dist/utils/BrowserUtils.d.ts +75 -75
- package/dist/utils/BrowserUtils.mjs +157 -157
- package/lib/msal-browser.cjs +19027 -18857
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +19027 -18857
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +62 -62
- package/package.json +2 -2
- package/src/cache/BrowserCacheManager.ts +95 -0
- package/src/config/Configuration.ts +9 -1
- package/src/controllers/StandardController.ts +30 -12
- package/src/error/BrowserAuthError.ts +2 -0
- package/src/error/BrowserAuthErrorCodes.ts +1 -0
- package/src/interaction_client/PopupClient.ts +202 -117
- package/src/interaction_client/RedirectClient.ts +62 -2
- package/src/interaction_client/SilentIframeClient.ts +41 -3
- package/src/interaction_handler/RedirectHandler.ts +1 -0
- package/src/naa/BridgeProxy.ts +7 -2
- package/src/packageMetadata.ts +1 -1
- package/src/request/RedirectRequest.ts +5 -0
- package/src/telemetry/BrowserPerformanceClient.ts +1 -1
- package/src/utils/BrowserConstants.ts +2 -0
|
@@ -1,386 +1,411 @@
|
|
|
1
|
-
import { CommonAuthorizationCodeRequest, ICrypto, AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager, ServerTelemetryEntity, ThrottlingEntity, Logger, AuthorityMetadataEntity, AccountInfo, ValidCredentialType, TokenKeys, CredentialType, CacheRecord, IPerformanceClient, StaticAuthorityOptions, StoreInCache } from "@azure/msal-common";
|
|
2
|
-
import { CacheOptions } from "../config/Configuration";
|
|
3
|
-
import { BrowserCacheLocation, InteractionType } from "../utils/BrowserConstants";
|
|
4
|
-
import { MemoryStorage } from "./MemoryStorage";
|
|
5
|
-
import { IWindowStorage } from "./IWindowStorage";
|
|
6
|
-
import { NativeTokenRequest } from "../broker/nativeBroker/NativeRequest";
|
|
7
|
-
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
8
|
-
import { SilentRequest } from "../request/SilentRequest";
|
|
9
|
-
import { SsoSilentRequest } from "../request/SsoSilentRequest";
|
|
10
|
-
import { RedirectRequest } from "../request/RedirectRequest";
|
|
11
|
-
import { PopupRequest } from "../request/PopupRequest";
|
|
12
|
-
/**
|
|
13
|
-
* This class implements the cache storage interface for MSAL through browser local or session storage.
|
|
14
|
-
* Cookies are only used if storeAuthStateInCookie is true, and are only used for
|
|
15
|
-
* parameters such as state and nonce, generally.
|
|
16
|
-
*/
|
|
17
|
-
export declare class BrowserCacheManager extends CacheManager {
|
|
18
|
-
protected cacheConfig: Required<CacheOptions>;
|
|
19
|
-
protected browserStorage: IWindowStorage<string>;
|
|
20
|
-
protected internalStorage: MemoryStorage<string>;
|
|
21
|
-
protected temporaryCacheStorage: IWindowStorage<string>;
|
|
22
|
-
protected logger: Logger;
|
|
23
|
-
protected performanceClient?: IPerformanceClient;
|
|
24
|
-
protected readonly COOKIE_LIFE_MULTIPLIER: number;
|
|
25
|
-
constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger, staticAuthorityOptions?: StaticAuthorityOptions, performanceClient?: IPerformanceClient);
|
|
26
|
-
/**
|
|
27
|
-
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
|
28
|
-
* @param cacheLocation
|
|
29
|
-
*/
|
|
30
|
-
protected setupBrowserStorage(cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.
|
|
33
|
-
* @param temporaryCacheLocation
|
|
34
|
-
* @param cacheLocation
|
|
35
|
-
*/
|
|
36
|
-
protected setupTemporaryCacheStorage(temporaryCacheLocation: BrowserCacheLocation | string, cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
|
|
37
|
-
/**
|
|
38
|
-
* Migrate all old cache entries to new schema. No rollback supported.
|
|
39
|
-
* @param storeAuthStateInCookie
|
|
40
|
-
*/
|
|
41
|
-
protected migrateCacheEntries(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Searches all cache entries for MSAL accounts and creates the account key map
|
|
44
|
-
* This is used to migrate users from older versions of MSAL which did not create the map.
|
|
45
|
-
* @returns
|
|
46
|
-
*/
|
|
47
|
-
private createKeyMaps;
|
|
48
|
-
/**
|
|
49
|
-
* Parses passed value as JSON object, JSON.parse() will throw an error.
|
|
50
|
-
* @param input
|
|
51
|
-
*/
|
|
52
|
-
protected validateAndParseJson(jsonValue: string): object | null;
|
|
53
|
-
/**
|
|
54
|
-
* fetches the entry from the browser storage based off the key
|
|
55
|
-
* @param key
|
|
56
|
-
*/
|
|
57
|
-
getItem(key: string): string | null;
|
|
58
|
-
/**
|
|
59
|
-
* sets the entry in the browser storage
|
|
60
|
-
* @param key
|
|
61
|
-
* @param value
|
|
62
|
-
*/
|
|
63
|
-
setItem(key: string, value: string): void;
|
|
64
|
-
/**
|
|
65
|
-
* fetch the account entity from the platform cache
|
|
66
|
-
* @param accountKey
|
|
67
|
-
*/
|
|
68
|
-
getAccount(accountKey: string, logger?: Logger): AccountEntity | null;
|
|
69
|
-
/**
|
|
70
|
-
* Reads account from cache, deserializes it into an account entity and returns it.
|
|
71
|
-
* If account is not found from the key, returns null and removes key from map.
|
|
72
|
-
* @param accountKey
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
getCachedAccountEntity(accountKey: string): AccountEntity | null;
|
|
76
|
-
/**
|
|
77
|
-
* set account entity in the platform cache
|
|
78
|
-
* @param account
|
|
79
|
-
*/
|
|
80
|
-
setAccount(account: AccountEntity): void;
|
|
81
|
-
/**
|
|
82
|
-
* Returns the array of account keys currently cached
|
|
83
|
-
* @returns
|
|
84
|
-
*/
|
|
85
|
-
getAccountKeys(): Array<string>;
|
|
86
|
-
/**
|
|
87
|
-
* Add a new account to the key map
|
|
88
|
-
* @param key
|
|
89
|
-
*/
|
|
90
|
-
addAccountKeyToMap(key: string): void;
|
|
91
|
-
/**
|
|
92
|
-
* Remove an account from the key map
|
|
93
|
-
* @param key
|
|
94
|
-
*/
|
|
95
|
-
removeAccountKeyFromMap(key: string): void;
|
|
96
|
-
/**
|
|
97
|
-
* Extends inherited removeAccount function to include removal of the account key from the map
|
|
98
|
-
* @param key
|
|
99
|
-
*/
|
|
100
|
-
removeAccount(key: string): Promise<void>;
|
|
101
|
-
/**
|
|
102
|
-
* Remove account entity from the platform cache if it's outdated
|
|
103
|
-
* @param accountKey
|
|
104
|
-
*/
|
|
105
|
-
removeOutdatedAccount(accountKey: string): void;
|
|
106
|
-
/**
|
|
107
|
-
* Removes given idToken from the cache and from the key map
|
|
108
|
-
* @param key
|
|
109
|
-
*/
|
|
110
|
-
removeIdToken(key: string): void;
|
|
111
|
-
/**
|
|
112
|
-
* Removes given accessToken from the cache and from the key map
|
|
113
|
-
* @param key
|
|
114
|
-
*/
|
|
115
|
-
removeAccessToken(key: string): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Removes given refreshToken from the cache and from the key map
|
|
118
|
-
* @param key
|
|
119
|
-
*/
|
|
120
|
-
removeRefreshToken(key: string): void;
|
|
121
|
-
/**
|
|
122
|
-
* Gets the keys for the cached tokens associated with this clientId
|
|
123
|
-
* @returns
|
|
124
|
-
*/
|
|
125
|
-
getTokenKeys(): TokenKeys;
|
|
126
|
-
/**
|
|
127
|
-
* Adds the given key to the token key map
|
|
128
|
-
* @param key
|
|
129
|
-
* @param type
|
|
130
|
-
*/
|
|
131
|
-
addTokenKey(key: string, type: CredentialType): void;
|
|
132
|
-
/**
|
|
133
|
-
* Removes the given key from the token key map
|
|
134
|
-
* @param key
|
|
135
|
-
* @param type
|
|
136
|
-
*/
|
|
137
|
-
removeTokenKey(key: string, type: CredentialType): void;
|
|
138
|
-
/**
|
|
139
|
-
* generates idToken entity from a string
|
|
140
|
-
* @param idTokenKey
|
|
141
|
-
*/
|
|
142
|
-
getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
|
|
143
|
-
/**
|
|
144
|
-
* set IdToken credential to the platform cache
|
|
145
|
-
* @param idToken
|
|
146
|
-
*/
|
|
147
|
-
setIdTokenCredential(idToken: IdTokenEntity): void;
|
|
148
|
-
/**
|
|
149
|
-
* generates accessToken entity from a string
|
|
150
|
-
* @param key
|
|
151
|
-
*/
|
|
152
|
-
getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
|
|
153
|
-
/**
|
|
154
|
-
* set accessToken credential to the platform cache
|
|
155
|
-
* @param accessToken
|
|
156
|
-
*/
|
|
157
|
-
setAccessTokenCredential(accessToken: AccessTokenEntity): void;
|
|
158
|
-
/**
|
|
159
|
-
* generates refreshToken entity from a string
|
|
160
|
-
* @param refreshTokenKey
|
|
161
|
-
*/
|
|
162
|
-
getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
|
|
163
|
-
/**
|
|
164
|
-
* set refreshToken credential to the platform cache
|
|
165
|
-
* @param refreshToken
|
|
166
|
-
*/
|
|
167
|
-
setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;
|
|
168
|
-
/**
|
|
169
|
-
* fetch appMetadata entity from the platform cache
|
|
170
|
-
* @param appMetadataKey
|
|
171
|
-
*/
|
|
172
|
-
getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
|
|
173
|
-
/**
|
|
174
|
-
* set appMetadata entity to the platform cache
|
|
175
|
-
* @param appMetadata
|
|
176
|
-
*/
|
|
177
|
-
setAppMetadata(appMetadata: AppMetadataEntity): void;
|
|
178
|
-
/**
|
|
179
|
-
* fetch server telemetry entity from the platform cache
|
|
180
|
-
* @param serverTelemetryKey
|
|
181
|
-
*/
|
|
182
|
-
getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;
|
|
183
|
-
/**
|
|
184
|
-
* set server telemetry entity to the platform cache
|
|
185
|
-
* @param serverTelemetryKey
|
|
186
|
-
* @param serverTelemetry
|
|
187
|
-
*/
|
|
188
|
-
setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;
|
|
189
|
-
/**
|
|
190
|
-
*
|
|
191
|
-
*/
|
|
192
|
-
getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;
|
|
193
|
-
/**
|
|
194
|
-
*
|
|
195
|
-
*/
|
|
196
|
-
getAuthorityMetadataKeys(): Array<string>;
|
|
197
|
-
/**
|
|
198
|
-
* Sets wrapper metadata in memory
|
|
199
|
-
* @param wrapperSKU
|
|
200
|
-
* @param wrapperVersion
|
|
201
|
-
*/
|
|
202
|
-
setWrapperMetadata(wrapperSKU: string, wrapperVersion: string): void;
|
|
203
|
-
/**
|
|
204
|
-
* Returns wrapper metadata from in-memory storage
|
|
205
|
-
*/
|
|
206
|
-
getWrapperMetadata(): [string, string];
|
|
207
|
-
/**
|
|
208
|
-
*
|
|
209
|
-
* @param entity
|
|
210
|
-
*/
|
|
211
|
-
setAuthorityMetadata(key: string, entity: AuthorityMetadataEntity): void;
|
|
212
|
-
/**
|
|
213
|
-
* Gets the active account
|
|
214
|
-
*/
|
|
215
|
-
getActiveAccount(): AccountInfo | null;
|
|
216
|
-
/**
|
|
217
|
-
* Sets the active account's localAccountId in cache
|
|
218
|
-
* @param account
|
|
219
|
-
*/
|
|
220
|
-
setActiveAccount(account: AccountInfo | null): void;
|
|
221
|
-
/**
|
|
222
|
-
* fetch throttling entity from the platform cache
|
|
223
|
-
* @param throttlingCacheKey
|
|
224
|
-
*/
|
|
225
|
-
getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;
|
|
226
|
-
/**
|
|
227
|
-
* set throttling entity to the platform cache
|
|
228
|
-
* @param throttlingCacheKey
|
|
229
|
-
* @param throttlingCache
|
|
230
|
-
*/
|
|
231
|
-
setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;
|
|
232
|
-
/**
|
|
233
|
-
* Gets cache item with given key.
|
|
234
|
-
* Will retrieve from cookies if storeAuthStateInCookie is set to true.
|
|
235
|
-
* @param key
|
|
236
|
-
*/
|
|
237
|
-
getTemporaryCache(cacheKey: string, generateKey?: boolean): string | null;
|
|
238
|
-
/**
|
|
239
|
-
* Sets the cache item with the key and value given.
|
|
240
|
-
* Stores in cookie if storeAuthStateInCookie is set to true.
|
|
241
|
-
* This can cause cookie overflow if used incorrectly.
|
|
242
|
-
* @param key
|
|
243
|
-
* @param value
|
|
244
|
-
*/
|
|
245
|
-
setTemporaryCache(cacheKey: string, value: string, generateKey?: boolean): void;
|
|
246
|
-
/**
|
|
247
|
-
* Removes the cache item with the given key.
|
|
248
|
-
* @param key
|
|
249
|
-
*/
|
|
250
|
-
removeItem(key: string): void;
|
|
251
|
-
/**
|
|
252
|
-
* Removes the temporary cache item with the given key.
|
|
253
|
-
* Will also clear the cookie item if storeAuthStateInCookie is set to true.
|
|
254
|
-
* @param key
|
|
255
|
-
*/
|
|
256
|
-
removeTemporaryItem(key: string): void;
|
|
257
|
-
/**
|
|
258
|
-
* Gets all keys in window.
|
|
259
|
-
*/
|
|
260
|
-
getKeys(): string[];
|
|
261
|
-
/**
|
|
262
|
-
* Clears all cache entries created by MSAL.
|
|
263
|
-
*/
|
|
264
|
-
clear(): Promise<void>;
|
|
265
|
-
/**
|
|
266
|
-
* Clears all access tokes that have claims prior to saving the current one
|
|
267
|
-
* @param performanceClient {IPerformanceClient}
|
|
268
|
-
* @param correlationId {string} correlation id
|
|
269
|
-
* @returns
|
|
270
|
-
*/
|
|
271
|
-
clearTokensAndKeysWithClaims(performanceClient: IPerformanceClient, correlationId: string): Promise<void>;
|
|
272
|
-
/**
|
|
273
|
-
* Add value to cookies
|
|
274
|
-
* @param cookieName
|
|
275
|
-
* @param cookieValue
|
|
276
|
-
* @param expires
|
|
277
|
-
* @deprecated
|
|
278
|
-
*/
|
|
279
|
-
setItemCookie(cookieName: string, cookieValue: string, expires?: number): void;
|
|
280
|
-
/**
|
|
281
|
-
* Get one item by key from cookies
|
|
282
|
-
* @param cookieName
|
|
283
|
-
* @deprecated
|
|
284
|
-
*/
|
|
285
|
-
getItemCookie(cookieName: string): string;
|
|
286
|
-
/**
|
|
287
|
-
* Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.
|
|
288
|
-
* @deprecated
|
|
289
|
-
*/
|
|
290
|
-
clearMsalCookies(): void;
|
|
291
|
-
/**
|
|
292
|
-
* Clear an item in the cookies by key
|
|
293
|
-
* @param cookieName
|
|
294
|
-
* @deprecated
|
|
295
|
-
*/
|
|
296
|
-
clearItemCookie(cookieName: string): void;
|
|
297
|
-
/**
|
|
298
|
-
* Get cookie expiration time
|
|
299
|
-
* @param cookieLifeDays
|
|
300
|
-
* @deprecated
|
|
301
|
-
*/
|
|
302
|
-
getCookieExpirationTime(cookieLifeDays: number): string;
|
|
303
|
-
/**
|
|
304
|
-
* Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
|
|
305
|
-
* @param key
|
|
306
|
-
* @param addInstanceId
|
|
307
|
-
*/
|
|
308
|
-
generateCacheKey(key: string): string;
|
|
309
|
-
/**
|
|
310
|
-
* Create authorityKey to cache authority
|
|
311
|
-
* @param state
|
|
312
|
-
*/
|
|
313
|
-
generateAuthorityKey(stateString: string): string;
|
|
314
|
-
/**
|
|
315
|
-
* Create Nonce key to cache nonce
|
|
316
|
-
* @param state
|
|
317
|
-
*/
|
|
318
|
-
generateNonceKey(stateString: string): string;
|
|
319
|
-
/**
|
|
320
|
-
* Creates full cache key for the request state
|
|
321
|
-
* @param stateString State string for the request
|
|
322
|
-
*/
|
|
323
|
-
generateStateKey(stateString: string): string;
|
|
324
|
-
/**
|
|
325
|
-
* Gets the cached authority based on the cached state. Returns empty if no cached state found.
|
|
326
|
-
*/
|
|
327
|
-
getCachedAuthority(cachedState: string): string | null;
|
|
328
|
-
/**
|
|
329
|
-
* Updates account, authority, and state in cache
|
|
330
|
-
* @param serverAuthenticationRequest
|
|
331
|
-
* @param account
|
|
332
|
-
*/
|
|
333
|
-
updateCacheEntries(state: string, nonce: string, authorityInstance: string, loginHint: string, account: AccountInfo | null): void;
|
|
334
|
-
/**
|
|
335
|
-
* Reset all temporary cache items
|
|
336
|
-
* @param state
|
|
337
|
-
*/
|
|
338
|
-
resetRequestCache(state: string): void;
|
|
339
|
-
/**
|
|
340
|
-
* Removes temporary cache for the provided state
|
|
341
|
-
* @param stateString
|
|
342
|
-
*/
|
|
343
|
-
cleanRequestByState(stateString: string): void;
|
|
344
|
-
/**
|
|
345
|
-
* Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state
|
|
346
|
-
* Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.
|
|
347
|
-
* @param interactionType
|
|
348
|
-
*/
|
|
349
|
-
cleanRequestByInteractionType(interactionType: InteractionType): void;
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
*
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
*
|
|
369
|
-
*/
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
*
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
*
|
|
382
|
-
*/
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
1
|
+
import { CommonAuthorizationCodeRequest, ICrypto, AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager, ServerTelemetryEntity, ThrottlingEntity, Logger, AuthorityMetadataEntity, AccountInfo, ValidCredentialType, TokenKeys, CredentialType, CacheRecord, IPerformanceClient, StaticAuthorityOptions, StoreInCache } from "@azure/msal-common";
|
|
2
|
+
import { CacheOptions } from "../config/Configuration";
|
|
3
|
+
import { BrowserCacheLocation, InteractionType } from "../utils/BrowserConstants";
|
|
4
|
+
import { MemoryStorage } from "./MemoryStorage";
|
|
5
|
+
import { IWindowStorage } from "./IWindowStorage";
|
|
6
|
+
import { NativeTokenRequest } from "../broker/nativeBroker/NativeRequest";
|
|
7
|
+
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
8
|
+
import { SilentRequest } from "../request/SilentRequest";
|
|
9
|
+
import { SsoSilentRequest } from "../request/SsoSilentRequest";
|
|
10
|
+
import { RedirectRequest } from "../request/RedirectRequest";
|
|
11
|
+
import { PopupRequest } from "../request/PopupRequest";
|
|
12
|
+
/**
|
|
13
|
+
* This class implements the cache storage interface for MSAL through browser local or session storage.
|
|
14
|
+
* Cookies are only used if storeAuthStateInCookie is true, and are only used for
|
|
15
|
+
* parameters such as state and nonce, generally.
|
|
16
|
+
*/
|
|
17
|
+
export declare class BrowserCacheManager extends CacheManager {
|
|
18
|
+
protected cacheConfig: Required<CacheOptions>;
|
|
19
|
+
protected browserStorage: IWindowStorage<string>;
|
|
20
|
+
protected internalStorage: MemoryStorage<string>;
|
|
21
|
+
protected temporaryCacheStorage: IWindowStorage<string>;
|
|
22
|
+
protected logger: Logger;
|
|
23
|
+
protected performanceClient?: IPerformanceClient;
|
|
24
|
+
protected readonly COOKIE_LIFE_MULTIPLIER: number;
|
|
25
|
+
constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger, staticAuthorityOptions?: StaticAuthorityOptions, performanceClient?: IPerformanceClient);
|
|
26
|
+
/**
|
|
27
|
+
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
|
28
|
+
* @param cacheLocation
|
|
29
|
+
*/
|
|
30
|
+
protected setupBrowserStorage(cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.
|
|
33
|
+
* @param temporaryCacheLocation
|
|
34
|
+
* @param cacheLocation
|
|
35
|
+
*/
|
|
36
|
+
protected setupTemporaryCacheStorage(temporaryCacheLocation: BrowserCacheLocation | string, cacheLocation: BrowserCacheLocation | string): IWindowStorage<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Migrate all old cache entries to new schema. No rollback supported.
|
|
39
|
+
* @param storeAuthStateInCookie
|
|
40
|
+
*/
|
|
41
|
+
protected migrateCacheEntries(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Searches all cache entries for MSAL accounts and creates the account key map
|
|
44
|
+
* This is used to migrate users from older versions of MSAL which did not create the map.
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
private createKeyMaps;
|
|
48
|
+
/**
|
|
49
|
+
* Parses passed value as JSON object, JSON.parse() will throw an error.
|
|
50
|
+
* @param input
|
|
51
|
+
*/
|
|
52
|
+
protected validateAndParseJson(jsonValue: string): object | null;
|
|
53
|
+
/**
|
|
54
|
+
* fetches the entry from the browser storage based off the key
|
|
55
|
+
* @param key
|
|
56
|
+
*/
|
|
57
|
+
getItem(key: string): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* sets the entry in the browser storage
|
|
60
|
+
* @param key
|
|
61
|
+
* @param value
|
|
62
|
+
*/
|
|
63
|
+
setItem(key: string, value: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* fetch the account entity from the platform cache
|
|
66
|
+
* @param accountKey
|
|
67
|
+
*/
|
|
68
|
+
getAccount(accountKey: string, logger?: Logger): AccountEntity | null;
|
|
69
|
+
/**
|
|
70
|
+
* Reads account from cache, deserializes it into an account entity and returns it.
|
|
71
|
+
* If account is not found from the key, returns null and removes key from map.
|
|
72
|
+
* @param accountKey
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
getCachedAccountEntity(accountKey: string): AccountEntity | null;
|
|
76
|
+
/**
|
|
77
|
+
* set account entity in the platform cache
|
|
78
|
+
* @param account
|
|
79
|
+
*/
|
|
80
|
+
setAccount(account: AccountEntity): void;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the array of account keys currently cached
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
getAccountKeys(): Array<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Add a new account to the key map
|
|
88
|
+
* @param key
|
|
89
|
+
*/
|
|
90
|
+
addAccountKeyToMap(key: string): void;
|
|
91
|
+
/**
|
|
92
|
+
* Remove an account from the key map
|
|
93
|
+
* @param key
|
|
94
|
+
*/
|
|
95
|
+
removeAccountKeyFromMap(key: string): void;
|
|
96
|
+
/**
|
|
97
|
+
* Extends inherited removeAccount function to include removal of the account key from the map
|
|
98
|
+
* @param key
|
|
99
|
+
*/
|
|
100
|
+
removeAccount(key: string): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Remove account entity from the platform cache if it's outdated
|
|
103
|
+
* @param accountKey
|
|
104
|
+
*/
|
|
105
|
+
removeOutdatedAccount(accountKey: string): void;
|
|
106
|
+
/**
|
|
107
|
+
* Removes given idToken from the cache and from the key map
|
|
108
|
+
* @param key
|
|
109
|
+
*/
|
|
110
|
+
removeIdToken(key: string): void;
|
|
111
|
+
/**
|
|
112
|
+
* Removes given accessToken from the cache and from the key map
|
|
113
|
+
* @param key
|
|
114
|
+
*/
|
|
115
|
+
removeAccessToken(key: string): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Removes given refreshToken from the cache and from the key map
|
|
118
|
+
* @param key
|
|
119
|
+
*/
|
|
120
|
+
removeRefreshToken(key: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* Gets the keys for the cached tokens associated with this clientId
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
getTokenKeys(): TokenKeys;
|
|
126
|
+
/**
|
|
127
|
+
* Adds the given key to the token key map
|
|
128
|
+
* @param key
|
|
129
|
+
* @param type
|
|
130
|
+
*/
|
|
131
|
+
addTokenKey(key: string, type: CredentialType): void;
|
|
132
|
+
/**
|
|
133
|
+
* Removes the given key from the token key map
|
|
134
|
+
* @param key
|
|
135
|
+
* @param type
|
|
136
|
+
*/
|
|
137
|
+
removeTokenKey(key: string, type: CredentialType): void;
|
|
138
|
+
/**
|
|
139
|
+
* generates idToken entity from a string
|
|
140
|
+
* @param idTokenKey
|
|
141
|
+
*/
|
|
142
|
+
getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
|
|
143
|
+
/**
|
|
144
|
+
* set IdToken credential to the platform cache
|
|
145
|
+
* @param idToken
|
|
146
|
+
*/
|
|
147
|
+
setIdTokenCredential(idToken: IdTokenEntity): void;
|
|
148
|
+
/**
|
|
149
|
+
* generates accessToken entity from a string
|
|
150
|
+
* @param key
|
|
151
|
+
*/
|
|
152
|
+
getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
|
|
153
|
+
/**
|
|
154
|
+
* set accessToken credential to the platform cache
|
|
155
|
+
* @param accessToken
|
|
156
|
+
*/
|
|
157
|
+
setAccessTokenCredential(accessToken: AccessTokenEntity): void;
|
|
158
|
+
/**
|
|
159
|
+
* generates refreshToken entity from a string
|
|
160
|
+
* @param refreshTokenKey
|
|
161
|
+
*/
|
|
162
|
+
getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
|
|
163
|
+
/**
|
|
164
|
+
* set refreshToken credential to the platform cache
|
|
165
|
+
* @param refreshToken
|
|
166
|
+
*/
|
|
167
|
+
setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;
|
|
168
|
+
/**
|
|
169
|
+
* fetch appMetadata entity from the platform cache
|
|
170
|
+
* @param appMetadataKey
|
|
171
|
+
*/
|
|
172
|
+
getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
|
|
173
|
+
/**
|
|
174
|
+
* set appMetadata entity to the platform cache
|
|
175
|
+
* @param appMetadata
|
|
176
|
+
*/
|
|
177
|
+
setAppMetadata(appMetadata: AppMetadataEntity): void;
|
|
178
|
+
/**
|
|
179
|
+
* fetch server telemetry entity from the platform cache
|
|
180
|
+
* @param serverTelemetryKey
|
|
181
|
+
*/
|
|
182
|
+
getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;
|
|
183
|
+
/**
|
|
184
|
+
* set server telemetry entity to the platform cache
|
|
185
|
+
* @param serverTelemetryKey
|
|
186
|
+
* @param serverTelemetry
|
|
187
|
+
*/
|
|
188
|
+
setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
*/
|
|
192
|
+
getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;
|
|
193
|
+
/**
|
|
194
|
+
*
|
|
195
|
+
*/
|
|
196
|
+
getAuthorityMetadataKeys(): Array<string>;
|
|
197
|
+
/**
|
|
198
|
+
* Sets wrapper metadata in memory
|
|
199
|
+
* @param wrapperSKU
|
|
200
|
+
* @param wrapperVersion
|
|
201
|
+
*/
|
|
202
|
+
setWrapperMetadata(wrapperSKU: string, wrapperVersion: string): void;
|
|
203
|
+
/**
|
|
204
|
+
* Returns wrapper metadata from in-memory storage
|
|
205
|
+
*/
|
|
206
|
+
getWrapperMetadata(): [string, string];
|
|
207
|
+
/**
|
|
208
|
+
*
|
|
209
|
+
* @param entity
|
|
210
|
+
*/
|
|
211
|
+
setAuthorityMetadata(key: string, entity: AuthorityMetadataEntity): void;
|
|
212
|
+
/**
|
|
213
|
+
* Gets the active account
|
|
214
|
+
*/
|
|
215
|
+
getActiveAccount(): AccountInfo | null;
|
|
216
|
+
/**
|
|
217
|
+
* Sets the active account's localAccountId in cache
|
|
218
|
+
* @param account
|
|
219
|
+
*/
|
|
220
|
+
setActiveAccount(account: AccountInfo | null): void;
|
|
221
|
+
/**
|
|
222
|
+
* fetch throttling entity from the platform cache
|
|
223
|
+
* @param throttlingCacheKey
|
|
224
|
+
*/
|
|
225
|
+
getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;
|
|
226
|
+
/**
|
|
227
|
+
* set throttling entity to the platform cache
|
|
228
|
+
* @param throttlingCacheKey
|
|
229
|
+
* @param throttlingCache
|
|
230
|
+
*/
|
|
231
|
+
setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;
|
|
232
|
+
/**
|
|
233
|
+
* Gets cache item with given key.
|
|
234
|
+
* Will retrieve from cookies if storeAuthStateInCookie is set to true.
|
|
235
|
+
* @param key
|
|
236
|
+
*/
|
|
237
|
+
getTemporaryCache(cacheKey: string, generateKey?: boolean): string | null;
|
|
238
|
+
/**
|
|
239
|
+
* Sets the cache item with the key and value given.
|
|
240
|
+
* Stores in cookie if storeAuthStateInCookie is set to true.
|
|
241
|
+
* This can cause cookie overflow if used incorrectly.
|
|
242
|
+
* @param key
|
|
243
|
+
* @param value
|
|
244
|
+
*/
|
|
245
|
+
setTemporaryCache(cacheKey: string, value: string, generateKey?: boolean): void;
|
|
246
|
+
/**
|
|
247
|
+
* Removes the cache item with the given key.
|
|
248
|
+
* @param key
|
|
249
|
+
*/
|
|
250
|
+
removeItem(key: string): void;
|
|
251
|
+
/**
|
|
252
|
+
* Removes the temporary cache item with the given key.
|
|
253
|
+
* Will also clear the cookie item if storeAuthStateInCookie is set to true.
|
|
254
|
+
* @param key
|
|
255
|
+
*/
|
|
256
|
+
removeTemporaryItem(key: string): void;
|
|
257
|
+
/**
|
|
258
|
+
* Gets all keys in window.
|
|
259
|
+
*/
|
|
260
|
+
getKeys(): string[];
|
|
261
|
+
/**
|
|
262
|
+
* Clears all cache entries created by MSAL.
|
|
263
|
+
*/
|
|
264
|
+
clear(): Promise<void>;
|
|
265
|
+
/**
|
|
266
|
+
* Clears all access tokes that have claims prior to saving the current one
|
|
267
|
+
* @param performanceClient {IPerformanceClient}
|
|
268
|
+
* @param correlationId {string} correlation id
|
|
269
|
+
* @returns
|
|
270
|
+
*/
|
|
271
|
+
clearTokensAndKeysWithClaims(performanceClient: IPerformanceClient, correlationId: string): Promise<void>;
|
|
272
|
+
/**
|
|
273
|
+
* Add value to cookies
|
|
274
|
+
* @param cookieName
|
|
275
|
+
* @param cookieValue
|
|
276
|
+
* @param expires
|
|
277
|
+
* @deprecated
|
|
278
|
+
*/
|
|
279
|
+
setItemCookie(cookieName: string, cookieValue: string, expires?: number): void;
|
|
280
|
+
/**
|
|
281
|
+
* Get one item by key from cookies
|
|
282
|
+
* @param cookieName
|
|
283
|
+
* @deprecated
|
|
284
|
+
*/
|
|
285
|
+
getItemCookie(cookieName: string): string;
|
|
286
|
+
/**
|
|
287
|
+
* Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.
|
|
288
|
+
* @deprecated
|
|
289
|
+
*/
|
|
290
|
+
clearMsalCookies(): void;
|
|
291
|
+
/**
|
|
292
|
+
* Clear an item in the cookies by key
|
|
293
|
+
* @param cookieName
|
|
294
|
+
* @deprecated
|
|
295
|
+
*/
|
|
296
|
+
clearItemCookie(cookieName: string): void;
|
|
297
|
+
/**
|
|
298
|
+
* Get cookie expiration time
|
|
299
|
+
* @param cookieLifeDays
|
|
300
|
+
* @deprecated
|
|
301
|
+
*/
|
|
302
|
+
getCookieExpirationTime(cookieLifeDays: number): string;
|
|
303
|
+
/**
|
|
304
|
+
* Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
|
|
305
|
+
* @param key
|
|
306
|
+
* @param addInstanceId
|
|
307
|
+
*/
|
|
308
|
+
generateCacheKey(key: string): string;
|
|
309
|
+
/**
|
|
310
|
+
* Create authorityKey to cache authority
|
|
311
|
+
* @param state
|
|
312
|
+
*/
|
|
313
|
+
generateAuthorityKey(stateString: string): string;
|
|
314
|
+
/**
|
|
315
|
+
* Create Nonce key to cache nonce
|
|
316
|
+
* @param state
|
|
317
|
+
*/
|
|
318
|
+
generateNonceKey(stateString: string): string;
|
|
319
|
+
/**
|
|
320
|
+
* Creates full cache key for the request state
|
|
321
|
+
* @param stateString State string for the request
|
|
322
|
+
*/
|
|
323
|
+
generateStateKey(stateString: string): string;
|
|
324
|
+
/**
|
|
325
|
+
* Gets the cached authority based on the cached state. Returns empty if no cached state found.
|
|
326
|
+
*/
|
|
327
|
+
getCachedAuthority(cachedState: string): string | null;
|
|
328
|
+
/**
|
|
329
|
+
* Updates account, authority, and state in cache
|
|
330
|
+
* @param serverAuthenticationRequest
|
|
331
|
+
* @param account
|
|
332
|
+
*/
|
|
333
|
+
updateCacheEntries(state: string, nonce: string, authorityInstance: string, loginHint: string, account: AccountInfo | null): void;
|
|
334
|
+
/**
|
|
335
|
+
* Reset all temporary cache items
|
|
336
|
+
* @param state
|
|
337
|
+
*/
|
|
338
|
+
resetRequestCache(state: string): void;
|
|
339
|
+
/**
|
|
340
|
+
* Removes temporary cache for the provided state
|
|
341
|
+
* @param stateString
|
|
342
|
+
*/
|
|
343
|
+
cleanRequestByState(stateString: string): void;
|
|
344
|
+
/**
|
|
345
|
+
* Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state
|
|
346
|
+
* Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.
|
|
347
|
+
* @param interactionType
|
|
348
|
+
*/
|
|
349
|
+
cleanRequestByInteractionType(interactionType: InteractionType): void;
|
|
350
|
+
/**
|
|
351
|
+
* Create request retry key to cache retry status
|
|
352
|
+
*/
|
|
353
|
+
generateRequestRetriedKey(): string;
|
|
354
|
+
/**
|
|
355
|
+
* Gets the request retry value from the cache
|
|
356
|
+
*/
|
|
357
|
+
getRequestRetried(): number | null;
|
|
358
|
+
/**
|
|
359
|
+
* Sets the request retry value to "retried" in the cache
|
|
360
|
+
*/
|
|
361
|
+
setRequestRetried(): void;
|
|
362
|
+
/**
|
|
363
|
+
* Removes all request retry values in the cache
|
|
364
|
+
*/
|
|
365
|
+
removeRequestRetried(): void;
|
|
366
|
+
/**
|
|
367
|
+
* Caches the redirectRequest in the cache
|
|
368
|
+
* @param redirectRequest
|
|
369
|
+
*/
|
|
370
|
+
cacheRedirectRequest(redirectRequest: RedirectRequest): void;
|
|
371
|
+
/**
|
|
372
|
+
* Gets redirect request from the cache. Logs an error and returns undefined if nothing is found.
|
|
373
|
+
*/
|
|
374
|
+
getCachedRedirectRequest(): RedirectRequest | undefined;
|
|
375
|
+
cacheCodeRequest(authCodeRequest: CommonAuthorizationCodeRequest): void;
|
|
376
|
+
/**
|
|
377
|
+
* Gets the token exchange parameters from the cache. Throws an error if nothing is found.
|
|
378
|
+
*/
|
|
379
|
+
getCachedRequest(state: string): CommonAuthorizationCodeRequest;
|
|
380
|
+
/**
|
|
381
|
+
* Gets cached native request for redirect flows
|
|
382
|
+
*/
|
|
383
|
+
getCachedNativeRequest(): NativeTokenRequest | null;
|
|
384
|
+
isInteractionInProgress(matchClientId?: boolean): boolean;
|
|
385
|
+
getInteractionInProgress(): string | null;
|
|
386
|
+
setInteractionInProgress(inProgress: boolean): void;
|
|
387
|
+
/**
|
|
388
|
+
* Returns username retrieved from ADAL or MSAL v1 idToken
|
|
389
|
+
* @deprecated
|
|
390
|
+
*/
|
|
391
|
+
getLegacyLoginHint(): string | null;
|
|
392
|
+
/**
|
|
393
|
+
* Updates a credential's cache key if the current cache key is outdated
|
|
394
|
+
*/
|
|
395
|
+
updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;
|
|
396
|
+
/**
|
|
397
|
+
* Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache
|
|
398
|
+
* @param result
|
|
399
|
+
* @param request
|
|
400
|
+
*/
|
|
401
|
+
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
|
402
|
+
/**
|
|
403
|
+
* saves a cache record
|
|
404
|
+
* @param cacheRecord {CacheRecord}
|
|
405
|
+
* @param storeInCache {?StoreInCache}
|
|
406
|
+
* @param correlationId {?string} correlation id
|
|
407
|
+
*/
|
|
408
|
+
saveCacheRecord(cacheRecord: CacheRecord, storeInCache?: StoreInCache, correlationId?: string): Promise<void>;
|
|
409
|
+
}
|
|
410
|
+
export declare const DEFAULT_BROWSER_CACHE_MANAGER: (clientId: string, logger: Logger) => BrowserCacheManager;
|
|
386
411
|
//# sourceMappingURL=BrowserCacheManager.d.ts.map
|