@azure/msal-browser 3.2.0 → 3.4.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.mjs +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.mjs +3 -4
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientNext.d.ts +274 -0
- package/dist/app/PublicClientNext.d.ts.map +1 -0
- package/dist/app/PublicClientNext.mjs +360 -0
- package/dist/app/PublicClientNext.mjs.map +1 -0
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +2 -13
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +26 -83
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/CryptoKeyStore.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +5 -5
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +4 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +2 -1
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/ControllerFactory.d.ts +2 -7
- package/dist/controllers/ControllerFactory.d.ts.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +24 -34
- package/dist/controllers/ControllerFactory.mjs.map +1 -1
- package/dist/controllers/IController.d.ts +1 -2
- package/dist/controllers/IController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.d.ts +96 -0
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -0
- package/dist/controllers/NestedAppAuthController.mjs +345 -0
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -0
- package/dist/controllers/StandardController.d.ts +4 -4
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +43 -42
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +88 -0
- package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -0
- package/dist/controllers/UnknownOperatingContextController.mjs +275 -0
- package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -0
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +3 -3
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.mjs +8 -5
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.d.ts +15 -0
- package/dist/error/NestedAppAuthError.d.ts.map +1 -0
- package/dist/error/NestedAppAuthError.mjs +30 -0
- package/dist/error/NestedAppAuthError.mjs.map +1 -0
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +4 -4
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +18 -7
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +1 -2
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +13 -25
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +17 -25
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +6 -8
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +4 -3
- package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +28 -19
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +2 -12
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +5 -5
- package/dist/interaction_handler/InteractionHandler.d.ts +6 -13
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +29 -56
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +14 -7
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +28 -9
- package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +13 -47
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +120 -155
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/naa/AccountInfo.d.ts +13 -0
- package/dist/naa/AccountInfo.d.ts.map +1 -0
- package/dist/naa/AccountRequests.d.ts +10 -0
- package/dist/naa/AccountRequests.d.ts.map +1 -0
- package/dist/naa/AuthBridge.d.ts +6 -0
- package/dist/naa/AuthBridge.d.ts.map +1 -0
- package/dist/naa/BridgeCapabilities.d.ts +4 -0
- package/dist/naa/BridgeCapabilities.d.ts.map +1 -0
- package/dist/naa/BridgeError.d.ts +10 -0
- package/dist/naa/BridgeError.d.ts.map +1 -0
- package/dist/naa/BridgeError.mjs +12 -0
- package/dist/naa/BridgeError.mjs.map +1 -0
- package/dist/naa/BridgeProxy.d.ts +72 -0
- package/dist/naa/BridgeProxy.d.ts.map +1 -0
- package/dist/naa/BridgeProxy.mjs +154 -0
- package/dist/naa/BridgeProxy.mjs.map +1 -0
- package/dist/naa/BridgeRequest.d.ts +7 -0
- package/dist/naa/BridgeRequest.d.ts.map +1 -0
- package/dist/naa/BridgeRequestEnvelope.d.ts +14 -0
- package/dist/naa/BridgeRequestEnvelope.d.ts.map +1 -0
- package/dist/naa/BridgeResponseEnvelope.d.ts +11 -0
- package/dist/naa/BridgeResponseEnvelope.d.ts.map +1 -0
- package/dist/naa/BridgeStatusCode.d.ts +11 -0
- package/dist/naa/BridgeStatusCode.d.ts.map +1 -0
- package/dist/naa/BridgeStatusCode.mjs +20 -0
- package/dist/naa/BridgeStatusCode.mjs.map +1 -0
- package/dist/naa/IBridgeProxy.d.ts +11 -0
- package/dist/naa/IBridgeProxy.d.ts.map +1 -0
- package/dist/naa/InitializeBridgeResponse.d.ts +7 -0
- package/dist/naa/InitializeBridgeResponse.d.ts.map +1 -0
- package/dist/naa/TokenRequest.d.ts +22 -0
- package/dist/naa/TokenRequest.d.ts.map +1 -0
- package/dist/naa/TokenResponse.d.ts +17 -0
- package/dist/naa/TokenResponse.d.ts.map +1 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts +26 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +178 -0
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -0
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +7 -0
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +45 -4
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.d.ts +26 -0
- package/dist/operatingcontext/UnknownOperatingContext.d.ts.map +1 -0
- package/dist/operatingcontext/UnknownOperatingContext.mjs +49 -0
- package/dist/operatingcontext/UnknownOperatingContext.mjs.map +1 -0
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.d.ts +54 -53
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +114 -102
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +13221 -12385
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +13221 -12385
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +67 -68
- package/package.json +2 -2
- package/src/app/PublicClientApplication.ts +4 -3
- package/src/app/PublicClientNext.ts +444 -0
- package/src/cache/BrowserCacheManager.ts +33 -140
- package/src/cache/TokenCache.ts +5 -4
- package/src/config/Configuration.ts +5 -0
- package/src/controllers/ControllerFactory.ts +35 -43
- package/src/controllers/IController.ts +0 -6
- package/src/controllers/NestedAppAuthController.ts +525 -0
- package/src/controllers/StandardController.ts +50 -52
- package/src/controllers/UnknownOperatingContextController.ts +383 -0
- package/src/crypto/BrowserCrypto.ts +2 -2
- package/src/crypto/CryptoOps.ts +8 -5
- package/src/error/NestedAppAuthError.ts +32 -0
- package/src/index.ts +3 -10
- package/src/interaction_client/BaseInteractionClient.ts +1 -1
- package/src/interaction_client/NativeInteractionClient.ts +23 -6
- package/src/interaction_client/PopupClient.ts +41 -61
- package/src/interaction_client/RedirectClient.ts +42 -47
- package/src/interaction_client/SilentAuthCodeClient.ts +6 -16
- package/src/interaction_client/SilentCacheClient.ts +11 -3
- package/src/interaction_client/SilentIframeClient.ts +54 -34
- package/src/interaction_client/SilentRefreshClient.ts +5 -19
- package/src/interaction_client/StandardInteractionClient.ts +1 -1
- package/src/interaction_handler/InteractionHandler.ts +34 -104
- package/src/interaction_handler/RedirectHandler.ts +48 -22
- package/src/interaction_handler/SilentHandler.ts +177 -233
- package/src/naa/AccountInfo.ts +17 -0
- package/src/naa/AccountRequests.ts +16 -0
- package/src/naa/AuthBridge.ts +16 -0
- package/src/naa/BridgeCapabilities.ts +8 -0
- package/src/naa/BridgeError.ts +18 -0
- package/src/naa/BridgeProxy.ts +230 -0
- package/src/naa/BridgeRequest.ts +12 -0
- package/src/naa/BridgeRequestEnvelope.ts +46 -0
- package/src/naa/BridgeResponseEnvelope.ts +21 -0
- package/src/naa/BridgeStatusCode.ts +15 -0
- package/src/naa/IBridgeProxy.ts +25 -0
- package/src/naa/InitializeBridgeResponse.ts +12 -0
- package/src/naa/TokenRequest.ts +26 -0
- package/src/naa/TokenResponse.ts +61 -0
- package/src/naa/mapping/NestedAppAuthAdapter.ts +252 -0
- package/src/operatingcontext/TeamsAppOperatingContext.ts +43 -3
- package/src/operatingcontext/UnknownOperatingContext.ts +48 -0
- package/src/packageMetadata.ts +1 -1
- package/src/utils/BrowserUtils.ts +133 -125
- package/dist/utils/BrowserStringUtils.d.ts +0 -22
- package/dist/utils/BrowserStringUtils.d.ts.map +0 -1
- package/dist/utils/BrowserStringUtils.mjs +0 -144
- package/dist/utils/BrowserStringUtils.mjs.map +0 -1
- package/src/utils/BrowserStringUtils.ts +0 -143
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { TimeUtils, AuthToken, AuthError, InteractionRequiredAuthError, ServerError, ClientAuthError, ClientAuthErrorCodes } from '@azure/msal-common';
|
|
4
|
+
import { isBridgeError } from '../BridgeError.mjs';
|
|
5
|
+
import { BridgeStatusCode } from '../BridgeStatusCode.mjs';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
class NestedAppAuthAdapter {
|
|
12
|
+
constructor(clientId, clientCapabilities, crypto, logger) {
|
|
13
|
+
this.clientId = clientId;
|
|
14
|
+
this.clientCapabilities = clientCapabilities;
|
|
15
|
+
this.crypto = crypto;
|
|
16
|
+
this.logger = logger;
|
|
17
|
+
}
|
|
18
|
+
toNaaSilentTokenRequest(request) {
|
|
19
|
+
let extraParams;
|
|
20
|
+
if (request.extraQueryParameters === undefined) {
|
|
21
|
+
extraParams = new Map();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
extraParams = new Map(Object.entries(request.extraQueryParameters));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Need to get information about the client to populate request correctly
|
|
28
|
+
* For example: client id, client capabilities
|
|
29
|
+
*/
|
|
30
|
+
const tokenRequest = {
|
|
31
|
+
userObjectId: request.account?.homeAccountId,
|
|
32
|
+
clientId: this.clientId,
|
|
33
|
+
authority: request.authority,
|
|
34
|
+
scope: request.scopes.join(" "),
|
|
35
|
+
correlationId: request.correlationId !== undefined
|
|
36
|
+
? request.correlationId
|
|
37
|
+
: this.crypto.createNewGuid(),
|
|
38
|
+
prompt: request.prompt !== undefined ? request.prompt : "",
|
|
39
|
+
claims: request.claims !== undefined ? request.claims : "",
|
|
40
|
+
authenticationScheme: request.authenticationScheme !== undefined
|
|
41
|
+
? request.authenticationScheme
|
|
42
|
+
: "",
|
|
43
|
+
clientCapabilities: this.clientCapabilities,
|
|
44
|
+
extraParameters: extraParams,
|
|
45
|
+
};
|
|
46
|
+
return tokenRequest;
|
|
47
|
+
}
|
|
48
|
+
toNaaTokenRequest(request) {
|
|
49
|
+
let extraParams;
|
|
50
|
+
if (request.extraQueryParameters === undefined) {
|
|
51
|
+
extraParams = new Map();
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
extraParams = new Map(Object.entries(request.extraQueryParameters));
|
|
55
|
+
}
|
|
56
|
+
const tokenRequest = {
|
|
57
|
+
userObjectId: request.account?.homeAccountId,
|
|
58
|
+
clientId: this.clientId,
|
|
59
|
+
authority: request.authority,
|
|
60
|
+
scope: request.scopes.join(" "),
|
|
61
|
+
correlationId: request.correlationId !== undefined
|
|
62
|
+
? request.correlationId
|
|
63
|
+
: "",
|
|
64
|
+
prompt: request.prompt !== undefined ? request.prompt : "",
|
|
65
|
+
nonce: request.nonce !== undefined ? request.nonce : "",
|
|
66
|
+
claims: request.claims !== undefined ? request.claims : "",
|
|
67
|
+
state: request.state !== undefined ? request.state : "",
|
|
68
|
+
authenticationScheme: request.authenticationScheme !== undefined
|
|
69
|
+
? request.authenticationScheme
|
|
70
|
+
: "",
|
|
71
|
+
clientCapabilities: undefined,
|
|
72
|
+
extraParameters: extraParams,
|
|
73
|
+
};
|
|
74
|
+
return tokenRequest;
|
|
75
|
+
}
|
|
76
|
+
fromNaaTokenResponse(request, response) {
|
|
77
|
+
const expiresOn = new Date(TimeUtils.nowSeconds() + (response.expires_in || 0) * 1000);
|
|
78
|
+
const account = this.fromNaaAccountInfo(response.account);
|
|
79
|
+
const authenticationResult = {
|
|
80
|
+
authority: response.account.environment,
|
|
81
|
+
uniqueId: response.account.homeAccountId,
|
|
82
|
+
tenantId: response.account.tenantId,
|
|
83
|
+
scopes: response.scope.split(" "),
|
|
84
|
+
account: this.fromNaaAccountInfo(response.account),
|
|
85
|
+
idToken: response.id_token !== undefined ? response.id_token : "",
|
|
86
|
+
idTokenClaims: account.idTokenClaims !== undefined
|
|
87
|
+
? account.idTokenClaims
|
|
88
|
+
: {},
|
|
89
|
+
accessToken: response.access_token,
|
|
90
|
+
fromCache: true,
|
|
91
|
+
expiresOn: expiresOn,
|
|
92
|
+
tokenType: request.authenticationScheme !== undefined
|
|
93
|
+
? request.authenticationScheme
|
|
94
|
+
: "Bearer",
|
|
95
|
+
correlationId: request.correlationId,
|
|
96
|
+
requestId: "",
|
|
97
|
+
extExpiresOn: expiresOn,
|
|
98
|
+
state: response.state,
|
|
99
|
+
};
|
|
100
|
+
return authenticationResult;
|
|
101
|
+
}
|
|
102
|
+
/*
|
|
103
|
+
* export type AccountInfo = {
|
|
104
|
+
* homeAccountId: string;
|
|
105
|
+
* environment: string;
|
|
106
|
+
* tenantId: string;
|
|
107
|
+
* username: string;
|
|
108
|
+
* localAccountId: string;
|
|
109
|
+
* name?: string;
|
|
110
|
+
* idToken?: string;
|
|
111
|
+
* idTokenClaims?: TokenClaims & {
|
|
112
|
+
* [key: string]:
|
|
113
|
+
* | string
|
|
114
|
+
* | number
|
|
115
|
+
* | string[]
|
|
116
|
+
* | object
|
|
117
|
+
* | undefined
|
|
118
|
+
* | unknown;
|
|
119
|
+
* };
|
|
120
|
+
* nativeAccountId?: string;
|
|
121
|
+
* authorityType?: string;
|
|
122
|
+
* };
|
|
123
|
+
*/
|
|
124
|
+
fromNaaAccountInfo(fromAccount) {
|
|
125
|
+
let tokenClaims;
|
|
126
|
+
if (fromAccount.idToken !== undefined) {
|
|
127
|
+
tokenClaims = AuthToken.extractTokenClaims(fromAccount.idToken, this.crypto.base64Decode);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
tokenClaims = undefined;
|
|
131
|
+
}
|
|
132
|
+
const account = {
|
|
133
|
+
homeAccountId: fromAccount.homeAccountId,
|
|
134
|
+
environment: fromAccount.environment,
|
|
135
|
+
tenantId: fromAccount.tenantId,
|
|
136
|
+
username: fromAccount.username,
|
|
137
|
+
localAccountId: fromAccount.localAccountId,
|
|
138
|
+
name: fromAccount.name,
|
|
139
|
+
idToken: fromAccount.idToken,
|
|
140
|
+
idTokenClaims: tokenClaims,
|
|
141
|
+
};
|
|
142
|
+
return account;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* @param error BridgeError
|
|
147
|
+
* @returns AuthError, ClientAuthError, ClientConfigurationError, ServerError, InteractionRequiredError
|
|
148
|
+
*/
|
|
149
|
+
fromBridgeError(error) {
|
|
150
|
+
if (isBridgeError(error)) {
|
|
151
|
+
switch (error.status) {
|
|
152
|
+
case BridgeStatusCode.USER_CANCEL:
|
|
153
|
+
return new ClientAuthError(ClientAuthErrorCodes.userCanceled);
|
|
154
|
+
case BridgeStatusCode.NO_NETWORK:
|
|
155
|
+
return new ClientAuthError(ClientAuthErrorCodes.noNetworkConnectivity);
|
|
156
|
+
case BridgeStatusCode.ACCOUNT_UNAVAILABLE:
|
|
157
|
+
return new ClientAuthError(ClientAuthErrorCodes.noAccountFound);
|
|
158
|
+
case BridgeStatusCode.DISABLED:
|
|
159
|
+
return new ClientAuthError(ClientAuthErrorCodes.nestedAppAuthBridgeDisabled);
|
|
160
|
+
case BridgeStatusCode.NESTED_APP_AUTH_UNAVAILABLE:
|
|
161
|
+
return new ClientAuthError(error.code, error.description);
|
|
162
|
+
case BridgeStatusCode.TRANSIENT_ERROR:
|
|
163
|
+
case BridgeStatusCode.PERSISTENT_ERROR:
|
|
164
|
+
return new ServerError(error.code, error.description);
|
|
165
|
+
case BridgeStatusCode.USER_INTERACTION_REQUIRED:
|
|
166
|
+
return new InteractionRequiredAuthError(error.code, error.description);
|
|
167
|
+
default:
|
|
168
|
+
return new AuthError(error.code, error.description);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
return new AuthError("unknown_error", "An unknown error occurred");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export { NestedAppAuthAdapter };
|
|
178
|
+
//# sourceMappingURL=NestedAppAuthAdapter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedAppAuthAdapter.mjs","sources":["../../../src/naa/mapping/NestedAppAuthAdapter.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AAmBO,MAAE,oBAAsB,CAAA;AAG/B,IAAA,WAAA,CAAA,QAAiC,EAAA,kBAAA,EAAA,MAAA,EAAA,MAAA,EAAA;AAC7B,QAAA,IAAA,CAAS,QAAS,GAAA,QAAQ,CAAA;AAC1B,QAAA,IAAA,CAAS,kBAAgB,GAAA,kBAAA,CAAA;AACzB,QAAA,IAAA,CAAS,MAAC,GAAQ,MAAE,CAAA;AACpB,QAAA,IAAA,CAAS,MAAC,GAAA,MAAA,CAAA;AAGN,KAAA;AAWG,IAAA,uBAAuB,CAAC,OAAO,EAAE;AAmCjC,QAAA,IAAA,WACI,CAAA;QAmCgB,IAAA,OAAA,CAAA,oBACd,KAAA,SACD,EAAA;AAyDL,YAAA,WAAmB,GAAA,IAAA,GAAA,EAAa,CAAA;AAyBvC,SAAA;;;;AAIG;AACI;AA2CV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { BaseOperatingContext } from "./BaseOperatingContext";
|
|
2
|
+
import { IBridgeProxy } from "../naa/IBridgeProxy";
|
|
3
|
+
import { AccountInfo } from "../naa/AccountInfo";
|
|
2
4
|
export declare class TeamsAppOperatingContext extends BaseOperatingContext {
|
|
5
|
+
protected bridgeProxy: IBridgeProxy | undefined;
|
|
6
|
+
protected activeAccount: AccountInfo | undefined;
|
|
3
7
|
static readonly MODULE_NAME: string;
|
|
4
8
|
/**
|
|
5
9
|
* Unique identifier for the operating context
|
|
@@ -16,6 +20,9 @@ export declare class TeamsAppOperatingContext extends BaseOperatingContext {
|
|
|
16
20
|
* @returns string
|
|
17
21
|
*/
|
|
18
22
|
getId(): string;
|
|
23
|
+
getBridgeProxy(): IBridgeProxy | undefined;
|
|
24
|
+
getActiveAccount(): AccountInfo | undefined;
|
|
25
|
+
setActiveAccount(account: AccountInfo): void;
|
|
19
26
|
/**
|
|
20
27
|
* Checks whether the operating context is available.
|
|
21
28
|
* Confirms that the code is running a browser rather. This is required.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeamsAppOperatingContext.d.ts","sourceRoot":"","sources":["../../src/operatingcontext/TeamsAppOperatingContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"TeamsAppOperatingContext.d.ts","sourceRoot":"","sources":["../../src/operatingcontext/TeamsAppOperatingContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,wBAAyB,SAAQ,oBAAoB;IAC9D,SAAS,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAa;IAC5D,SAAS,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,CAAa;IAM7D,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAM;IAEzC;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAA8B;IAExD;;;;OAIG;IACH,aAAa,IAAI,MAAM;IAGvB;;;OAGG;IACH,KAAK,IAAI,MAAM;IAIf,cAAc,IAAI,YAAY,GAAG,SAAS;IAI1C,gBAAgB,IAAI,WAAW,GAAG,SAAS;IAI3C,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAI5C;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;CA6BvC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { BaseOperatingContext } from './BaseOperatingContext.mjs';
|
|
4
|
+
import { BridgeProxy } from '../naa/BridgeProxy.mjs';
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
8
|
* Licensed under the MIT License.
|
|
8
9
|
*/
|
|
9
10
|
class TeamsAppOperatingContext extends BaseOperatingContext {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.bridgeProxy = undefined;
|
|
14
|
+
this.activeAccount = undefined;
|
|
15
|
+
}
|
|
10
16
|
/**
|
|
11
17
|
* Return the module name. Intended for use with import() to enable dynamic import
|
|
12
18
|
* of the implementation associated with this operating context
|
|
@@ -22,6 +28,15 @@ class TeamsAppOperatingContext extends BaseOperatingContext {
|
|
|
22
28
|
getId() {
|
|
23
29
|
return TeamsAppOperatingContext.ID;
|
|
24
30
|
}
|
|
31
|
+
getBridgeProxy() {
|
|
32
|
+
return this.bridgeProxy;
|
|
33
|
+
}
|
|
34
|
+
getActiveAccount() {
|
|
35
|
+
return this.activeAccount;
|
|
36
|
+
}
|
|
37
|
+
setActiveAccount(account) {
|
|
38
|
+
this.activeAccount = account;
|
|
39
|
+
}
|
|
25
40
|
/**
|
|
26
41
|
* Checks whether the operating context is available.
|
|
27
42
|
* Confirms that the code is running a browser rather. This is required.
|
|
@@ -29,10 +44,36 @@ class TeamsAppOperatingContext extends BaseOperatingContext {
|
|
|
29
44
|
*/
|
|
30
45
|
async initialize() {
|
|
31
46
|
/*
|
|
32
|
-
* TODO: Add implementation to check for presence of inject
|
|
33
|
-
*
|
|
47
|
+
* TODO: Add implementation to check for presence of inject Nested App Auth Bridge JavaScript interface
|
|
48
|
+
*
|
|
34
49
|
*/
|
|
35
|
-
|
|
50
|
+
try {
|
|
51
|
+
if (typeof window !== "undefined") {
|
|
52
|
+
const bridgeProxy = await BridgeProxy.create();
|
|
53
|
+
/*
|
|
54
|
+
* Because we want single sign on we need to attempt to
|
|
55
|
+
* grab the active account as part of initialization
|
|
56
|
+
* this.activeAccount = await bridgeProxy.getActiveAccount();
|
|
57
|
+
*/
|
|
58
|
+
try {
|
|
59
|
+
this.activeAccount = await bridgeProxy.getActiveAccount();
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
this.activeAccount = undefined;
|
|
63
|
+
}
|
|
64
|
+
this.bridgeProxy = bridgeProxy;
|
|
65
|
+
this.available = bridgeProxy !== undefined;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.available = false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
this.available = false;
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
return this.available;
|
|
76
|
+
}
|
|
36
77
|
}
|
|
37
78
|
}
|
|
38
79
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TeamsAppOperatingContext.mjs","sources":["../../src/operatingcontext/TeamsAppOperatingContext.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TeamsAppOperatingContext.mjs","sources":["../../src/operatingcontext/TeamsAppOperatingContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;AACA;AAEA;AAEA;AAQI,MAAe,iCAA0B,oBAAA,CAAA;AAEzC,IAAA,WAAA,GAAA;;AAEG,QAAA,IAAA,CAAA,WAAA,GAAA,SAAA,CAAA;AACH,QAAA,IAAe,CAAA,yBAAyC,CAAA;AAExD,KAAA;;;;AAIG;AACH;AAGA,IAAA,aAAA,GAAA;;;AAGG;AACH;;;AAYA,IAAA,KAAA,GAAA;AAIA,QAAA,OAAA,wBAAA,CAAA,EAAA,CAAA;;;;AAIG,KAAA;AACG,IAAA,gBAAc,GAAA;AA6BvB,QAAA,OAAA,IAAA,CAAA,aAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseOperatingContext } from "./BaseOperatingContext";
|
|
2
|
+
export declare class UnknownOperatingContext extends BaseOperatingContext {
|
|
3
|
+
static readonly MODULE_NAME: string;
|
|
4
|
+
/**
|
|
5
|
+
* Unique identifier for the operating context
|
|
6
|
+
*/
|
|
7
|
+
static readonly ID: string;
|
|
8
|
+
/**
|
|
9
|
+
* Return the module name. Intended for use with import() to enable dynamic import
|
|
10
|
+
* of the implementation associated with this operating context
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
getModuleName(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the unique identifier for this operating context
|
|
16
|
+
* @returns string
|
|
17
|
+
*/
|
|
18
|
+
getId(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Checks whether the operating context is available.
|
|
21
|
+
* Confirms that the code is running a browser rather. This is required.
|
|
22
|
+
* @returns Promise<boolean> indicating whether this operating context is currently available.
|
|
23
|
+
*/
|
|
24
|
+
initialize(): Promise<boolean>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=UnknownOperatingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnknownOperatingContext.d.ts","sourceRoot":"","sources":["../../src/operatingcontext/UnknownOperatingContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,qBAAa,uBAAwB,SAAQ,oBAAoB;IAK7D,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAM;IAEzC;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAA6B;IAEvD;;;;OAIG;IACH,aAAa,IAAI,MAAM;IAGvB;;;OAGG;IACH,KAAK,IAAI,MAAM;IAIf;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;CAOvC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { BaseOperatingContext } from './BaseOperatingContext.mjs';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
class UnknownOperatingContext extends BaseOperatingContext {
|
|
10
|
+
/**
|
|
11
|
+
* Return the module name. Intended for use with import() to enable dynamic import
|
|
12
|
+
* of the implementation associated with this operating context
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
getModuleName() {
|
|
16
|
+
return UnknownOperatingContext.MODULE_NAME;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns the unique identifier for this operating context
|
|
20
|
+
* @returns string
|
|
21
|
+
*/
|
|
22
|
+
getId() {
|
|
23
|
+
return UnknownOperatingContext.ID;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Checks whether the operating context is available.
|
|
27
|
+
* Confirms that the code is running a browser rather. This is required.
|
|
28
|
+
* @returns Promise<boolean> indicating whether this operating context is currently available.
|
|
29
|
+
*/
|
|
30
|
+
async initialize() {
|
|
31
|
+
/**
|
|
32
|
+
* This operating context is in use when we have not checked for what the operating context is.
|
|
33
|
+
* The context is unknown until we check it.
|
|
34
|
+
*/
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/*
|
|
39
|
+
* TODO: Once we have determine the bundling code return here to specify the name of the bundle
|
|
40
|
+
* containing the implementation for this operating context
|
|
41
|
+
*/
|
|
42
|
+
UnknownOperatingContext.MODULE_NAME = "";
|
|
43
|
+
/**
|
|
44
|
+
* Unique identifier for the operating context
|
|
45
|
+
*/
|
|
46
|
+
UnknownOperatingContext.ID = "UnknownOperatingContext";
|
|
47
|
+
|
|
48
|
+
export { UnknownOperatingContext };
|
|
49
|
+
//# sourceMappingURL=UnknownOperatingContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnknownOperatingContext.mjs","sources":["../../src/operatingcontext/UnknownOperatingContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAKA;AAEA;AAKI;AAEA;AAEG,MAAA,uBAAA,SAAA,oBAAA,CAAA;AACH;AAEA;;;;AAIG,IAAA,aAAA,GAAA;AACH,QAAA,OAAA,uBAAuB,CAAA,WAAA,CAAA;AAGvB,KAAA;;;AAGG;AACH;AAIA,IAAA,KAAA,GAAA;;;;AAIG;AACG;AAOT;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/packageMetadata.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.4.0 2023-10-30 */
|
|
2
2
|
'use strict';
|
|
3
3
|
/* eslint-disable header/header */
|
|
4
4
|
const name = "@azure/msal-browser";
|
|
5
|
-
const version = "3.
|
|
5
|
+
const version = "3.4.0";
|
|
6
6
|
|
|
7
7
|
export { name, version };
|
|
8
8
|
//# sourceMappingURL=packageMetadata.mjs.map
|
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
import { InteractionType } from "./BrowserConstants";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
3
|
+
* Clears hash from window url.
|
|
4
|
+
*/
|
|
5
|
+
export declare function clearHash(contentWindow: Window): void;
|
|
6
|
+
/**
|
|
7
|
+
* Replaces current hash with hash from provided url
|
|
8
|
+
*/
|
|
9
|
+
export declare function replaceHash(url: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Returns boolean of whether the current window is in an iframe or not.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isInIframe(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns boolean of whether or not the current window is a popup opened by msal
|
|
16
|
+
*/
|
|
17
|
+
export declare function isInPopup(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns current window URL as redirect uri
|
|
20
|
+
*/
|
|
21
|
+
export declare function getCurrentUri(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the homepage url for the current window location.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getHomepage(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Throws error if we have completed an auth and are
|
|
28
|
+
* attempting another auth request inside an iframe.
|
|
29
|
+
*/
|
|
30
|
+
export declare function blockReloadInHiddenIframes(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Block redirect operations in iframes unless explicitly allowed
|
|
33
|
+
* @param interactionType Interaction type for the request
|
|
34
|
+
* @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe
|
|
35
|
+
*/
|
|
36
|
+
export declare function blockRedirectInIframe(interactionType: InteractionType, allowRedirectInIframe: boolean): void;
|
|
37
|
+
/**
|
|
38
|
+
* Block redirectUri loaded in popup from calling AcquireToken APIs
|
|
39
|
+
*/
|
|
40
|
+
export declare function blockAcquireTokenInPopups(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Throws error if token requests are made in non-browser environment
|
|
43
|
+
* @param isBrowserEnvironment Flag indicating if environment is a browser.
|
|
44
|
+
*/
|
|
45
|
+
export declare function blockNonBrowserEnvironment(isBrowserEnvironment: boolean): void;
|
|
46
|
+
/**
|
|
47
|
+
* Throws error if initialize hasn't been called
|
|
48
|
+
* @param initialized
|
|
49
|
+
*/
|
|
50
|
+
export declare function blockAPICallsBeforeInitialize(initialized: boolean): void;
|
|
51
|
+
/**
|
|
52
|
+
* Adds a preconnect link element to the header which begins DNS resolution and SSL connection in anticipation of the /token request
|
|
53
|
+
* @param loginDomain Authority domain, including https protocol e.g. https://login.microsoftonline.com
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
export declare function preconnect(authority: string): void;
|
|
56
57
|
//# sourceMappingURL=BrowserUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserUtils.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserUtils.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAEvE;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"BrowserUtils.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserUtils.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAEvE;;GAEG;AACH,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAWrD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAI7C;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAQnC;AAID;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAIpC;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAQjD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACjC,eAAe,EAAE,eAAe,EAChC,qBAAqB,EAAE,OAAO,GAC/B,IAAI,CAUN;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAKhD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACtC,oBAAoB,EAAE,OAAO,GAC9B,IAAI,CAMN;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAMxE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAalD"}
|