@azure/msal-common 14.6.0 → 14.6.2-alpha.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/account/AccountInfo.mjs +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.d.ts +2 -2
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +8 -4
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +12 -25
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +23 -44
- package/dist/authority/AuthorityFactory.mjs.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +9 -469
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +16 -482
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/cache/CacheManager.mjs +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/entities/CacheRecord.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +5 -5
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +3 -3
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +3 -3
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +4 -4
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.mjs +5 -5
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +3 -3
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index.cjs +116 -576
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/NetworkManager.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/RequestValidator.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +2 -2
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +11 -1
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.d.ts +23 -25
- package/dist/utils/TimeUtils.d.ts.map +1 -1
- package/dist/utils/TimeUtils.mjs +38 -40
- package/dist/utils/TimeUtils.mjs.map +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/package.json +3 -3
- package/src/authority/Authority.ts +12 -5
- package/src/authority/AuthorityFactory.ts +48 -92
- package/src/authority/AuthorityMetadata.ts +23 -526
- package/src/cache/utils/CacheHelpers.ts +1 -1
- package/src/client/AuthorizationCodeClient.ts +1 -1
- package/src/client/BaseClient.ts +10 -11
- package/src/client/RefreshTokenClient.ts +1 -1
- package/src/client/SilentFlowClient.ts +1 -1
- package/src/crypto/PopTokenGenerator.ts +1 -1
- package/src/index.ts +2 -2
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +1 -1
- package/src/utils/FunctionWrappers.ts +16 -0
- package/src/utils/TimeUtils.ts +37 -38
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { Authority, formatAuthorityUri } from "./Authority";
|
|
7
|
-
import {
|
|
8
|
-
createClientConfigurationError,
|
|
9
|
-
ClientConfigurationErrorCodes,
|
|
10
|
-
} from "../error/ClientConfigurationError";
|
|
11
7
|
import { INetworkModule } from "../network/INetworkModule";
|
|
12
8
|
import {
|
|
13
9
|
createClientAuthError,
|
|
@@ -20,99 +16,59 @@ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient"
|
|
|
20
16
|
import { PerformanceEvents } from "../telemetry/performance/PerformanceEvent";
|
|
21
17
|
import { invokeAsync } from "../utils/FunctionWrappers";
|
|
22
18
|
|
|
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
|
-
// Initialize authority and perform discovery endpoint check.
|
|
53
|
-
const acquireTokenAuthority: Authority =
|
|
54
|
-
AuthorityFactory.createInstance(
|
|
55
|
-
authorityUriFinal,
|
|
56
|
-
networkClient,
|
|
57
|
-
cacheManager,
|
|
58
|
-
authorityOptions,
|
|
59
|
-
logger,
|
|
60
|
-
performanceClient,
|
|
61
|
-
correlationId
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
await invokeAsync(
|
|
66
|
-
acquireTokenAuthority.resolveEndpointsAsync.bind(
|
|
67
|
-
acquireTokenAuthority
|
|
68
|
-
),
|
|
69
|
-
PerformanceEvents.AuthorityResolveEndpointsAsync,
|
|
70
|
-
logger,
|
|
71
|
-
performanceClient,
|
|
72
|
-
correlationId
|
|
73
|
-
)();
|
|
74
|
-
return acquireTokenAuthority;
|
|
75
|
-
} catch (e) {
|
|
76
|
-
throw createClientAuthError(
|
|
77
|
-
ClientAuthErrorCodes.endpointResolutionError
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
19
|
+
/**
|
|
20
|
+
* Create an authority object of the correct type based on the url
|
|
21
|
+
* Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)
|
|
22
|
+
*
|
|
23
|
+
* Also performs endpoint discovery.
|
|
24
|
+
*
|
|
25
|
+
* @param authorityUri
|
|
26
|
+
* @param networkClient
|
|
27
|
+
* @param protocolMode
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export async function createDiscoveredInstance(
|
|
31
|
+
authorityUri: string,
|
|
32
|
+
networkClient: INetworkModule,
|
|
33
|
+
cacheManager: ICacheManager,
|
|
34
|
+
authorityOptions: AuthorityOptions,
|
|
35
|
+
logger: Logger,
|
|
36
|
+
correlationId: string,
|
|
37
|
+
performanceClient?: IPerformanceClient
|
|
38
|
+
): Promise<Authority> {
|
|
39
|
+
performanceClient?.addQueueMeasurement(
|
|
40
|
+
PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,
|
|
41
|
+
correlationId
|
|
42
|
+
);
|
|
43
|
+
const authorityUriFinal = Authority.transformCIAMAuthority(
|
|
44
|
+
formatAuthorityUri(authorityUri)
|
|
45
|
+
);
|
|
81
46
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
static createInstance(
|
|
93
|
-
authorityUrl: string,
|
|
94
|
-
networkInterface: INetworkModule,
|
|
95
|
-
cacheManager: ICacheManager,
|
|
96
|
-
authorityOptions: AuthorityOptions,
|
|
97
|
-
logger: Logger,
|
|
98
|
-
performanceClient?: IPerformanceClient,
|
|
99
|
-
correlationId?: string
|
|
100
|
-
): Authority {
|
|
101
|
-
// Throw error if authority url is empty
|
|
102
|
-
if (!authorityUrl) {
|
|
103
|
-
throw createClientConfigurationError(
|
|
104
|
-
ClientConfigurationErrorCodes.urlEmptyError
|
|
105
|
-
);
|
|
106
|
-
}
|
|
47
|
+
// Initialize authority and perform discovery endpoint check.
|
|
48
|
+
const acquireTokenAuthority: Authority = new Authority(
|
|
49
|
+
authorityUriFinal,
|
|
50
|
+
networkClient,
|
|
51
|
+
cacheManager,
|
|
52
|
+
authorityOptions,
|
|
53
|
+
logger,
|
|
54
|
+
correlationId,
|
|
55
|
+
performanceClient
|
|
56
|
+
);
|
|
107
57
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
58
|
+
try {
|
|
59
|
+
await invokeAsync(
|
|
60
|
+
acquireTokenAuthority.resolveEndpointsAsync.bind(
|
|
61
|
+
acquireTokenAuthority
|
|
62
|
+
),
|
|
63
|
+
PerformanceEvents.AuthorityResolveEndpointsAsync,
|
|
113
64
|
logger,
|
|
114
65
|
performanceClient,
|
|
115
66
|
correlationId
|
|
67
|
+
)();
|
|
68
|
+
return acquireTokenAuthority;
|
|
69
|
+
} catch (e) {
|
|
70
|
+
throw createClientAuthError(
|
|
71
|
+
ClientAuthErrorCodes.endpointResolutionError
|
|
116
72
|
);
|
|
117
73
|
}
|
|
118
74
|
}
|