@azure/msal-common 14.1.0-alpha.0 → 14.1.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.d.ts +31 -32
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AuthToken.d.ts +17 -17
- package/dist/account/AuthToken.mjs +58 -58
- package/dist/account/CcsCredential.d.ts +9 -9
- package/dist/account/CcsCredential.mjs +8 -8
- package/dist/account/ClientCredentials.d.ts +14 -14
- package/dist/account/ClientInfo.d.ts +19 -19
- package/dist/account/ClientInfo.mjs +37 -37
- package/dist/account/TokenClaims.d.ts +65 -65
- package/dist/authority/Authority.d.ts +235 -235
- package/dist/authority/Authority.mjs +738 -738
- package/dist/authority/AuthorityFactory.d.ts +31 -31
- package/dist/authority/AuthorityFactory.mjs +47 -47
- package/dist/authority/AuthorityMetadata.d.ts +623 -623
- package/dist/authority/AuthorityMetadata.mjs +884 -884
- package/dist/authority/AuthorityOptions.d.ts +21 -21
- package/dist/authority/AuthorityOptions.mjs +18 -18
- package/dist/authority/AuthorityType.d.ts +10 -10
- package/dist/authority/AuthorityType.mjs +13 -13
- package/dist/authority/AzureRegion.d.ts +1 -1
- package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
- package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +8 -8
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +8 -8
- package/dist/authority/ImdsOptions.d.ts +5 -5
- package/dist/authority/OIDCOptions.d.ts +8 -8
- package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
- package/dist/authority/OpenIdConfigResponse.mjs +10 -10
- package/dist/authority/ProtocolMode.d.ts +8 -8
- package/dist/authority/ProtocolMode.mjs +11 -11
- package/dist/authority/RegionDiscovery.d.ts +32 -32
- package/dist/authority/RegionDiscovery.mjs +106 -106
- package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
- package/dist/cache/CacheManager.d.ts +464 -446
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +1049 -998
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +56 -56
- package/dist/cache/entities/AccessTokenEntity.mjs +109 -109
- package/dist/cache/entities/AccountEntity.d.ts +101 -101
- package/dist/cache/entities/AccountEntity.mjs +220 -220
- package/dist/cache/entities/AppMetadataEntity.d.ts +39 -39
- package/dist/cache/entities/AppMetadataEntity.mjs +66 -66
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +48 -48
- package/dist/cache/entities/AuthorityMetadataEntity.mjs +78 -78
- package/dist/cache/entities/CacheRecord.d.ts +14 -14
- package/dist/cache/entities/CacheRecord.mjs +14 -14
- package/dist/cache/entities/CredentialEntity.d.ts +88 -88
- package/dist/cache/entities/CredentialEntity.mjs +136 -136
- package/dist/cache/entities/IdTokenEntity.d.ts +34 -34
- package/dist/cache/entities/IdTokenEntity.mjs +56 -56
- package/dist/cache/entities/RefreshTokenEntity.d.ts +36 -36
- package/dist/cache/entities/RefreshTokenEntity.mjs +59 -59
- package/dist/cache/entities/ServerTelemetryEntity.d.ts +12 -12
- package/dist/cache/entities/ServerTelemetryEntity.mjs +27 -27
- package/dist/cache/entities/ThrottlingEntity.d.ts +13 -13
- package/dist/cache/entities/ThrottlingEntity.mjs +23 -23
- package/dist/cache/interface/ICacheManager.d.ts +166 -166
- package/dist/cache/interface/ICachePlugin.d.ts +5 -5
- package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
- package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
- package/dist/cache/persistence/TokenCacheContext.mjs +25 -25
- package/dist/cache/utils/CacheTypes.d.ts +66 -69
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +73 -73
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +408 -407
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +51 -51
- package/dist/client/BaseClient.mjs +98 -98
- package/dist/client/RefreshTokenClient.d.ts +35 -35
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +187 -179
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +26 -26
- package/dist/client/SilentFlowClient.mjs +123 -123
- package/dist/config/AppTokenProvider.d.ts +38 -38
- package/dist/config/ClientConfiguration.d.ts +150 -150
- package/dist/config/ClientConfiguration.mjs +97 -97
- package/dist/crypto/ICrypto.d.ts +58 -62
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +30 -33
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/IGuidGenerator.d.ts +4 -4
- package/dist/crypto/JoseHeader.d.ts +22 -22
- package/dist/crypto/JoseHeader.mjs +37 -37
- package/dist/crypto/PopTokenGenerator.d.ts +60 -60
- package/dist/crypto/PopTokenGenerator.mjs +82 -82
- package/dist/crypto/SignedHttpRequest.d.ts +11 -11
- package/dist/error/AuthError.d.ts +44 -44
- package/dist/error/AuthError.mjs +46 -46
- package/dist/error/AuthErrorCodes.d.ts +5 -5
- package/dist/error/AuthErrorCodes.mjs +9 -9
- package/dist/error/ClientAuthError.d.ts +232 -232
- package/dist/error/ClientAuthError.mjs +244 -244
- package/dist/error/ClientAuthErrorCodes.d.ts +43 -43
- package/dist/error/ClientAuthErrorCodes.mjs +47 -47
- package/dist/error/ClientConfigurationError.d.ts +128 -128
- package/dist/error/ClientConfigurationError.mjs +135 -135
- package/dist/error/ClientConfigurationErrorCodes.d.ts +22 -22
- package/dist/error/ClientConfigurationErrorCodes.mjs +26 -26
- package/dist/error/InteractionRequiredAuthError.d.ts +57 -57
- package/dist/error/InteractionRequiredAuthError.mjs +76 -76
- package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +5 -5
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +11 -11
- package/dist/error/JoseHeaderError.d.ts +15 -15
- package/dist/error/JoseHeaderError.mjs +22 -22
- package/dist/error/JoseHeaderErrorCodes.d.ts +2 -2
- package/dist/error/JoseHeaderErrorCodes.mjs +6 -6
- package/dist/error/ServerError.d.ts +7 -7
- package/dist/error/ServerError.mjs +14 -14
- package/dist/index.cjs +8672 -8608
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +96 -96
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/logger/Logger.d.ts +95 -95
- package/dist/logger/Logger.mjs +188 -188
- package/dist/network/INetworkModule.d.ts +29 -29
- package/dist/network/INetworkModule.mjs +12 -12
- package/dist/network/NetworkManager.d.ts +33 -33
- package/dist/network/NetworkManager.mjs +34 -34
- package/dist/network/RequestThumbprint.d.ts +16 -16
- package/dist/network/ThrottlingUtils.d.ts +42 -42
- package/dist/network/ThrottlingUtils.mjs +95 -95
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.mjs +4 -4
- package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
- package/dist/request/AuthenticationHeaderParser.mjs +55 -55
- package/dist/request/BaseAuthRequest.d.ts +40 -40
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
- package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
- package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
- package/dist/request/CommonEndSessionRequest.d.ts +21 -21
- package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
- package/dist/request/CommonRefreshTokenRequest.d.ts +22 -19
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +20 -18
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
- package/dist/request/NativeRequest.d.ts +19 -19
- package/dist/request/NativeSignOutRequest.d.ts +5 -5
- package/dist/request/RequestParameterBuilder.d.ts +217 -217
- package/dist/request/RequestParameterBuilder.mjs +381 -381
- package/dist/request/RequestValidator.d.ts +33 -33
- package/dist/request/RequestValidator.mjs +81 -81
- package/dist/request/ScopeSet.d.ts +88 -88
- package/dist/request/ScopeSet.mjs +197 -197
- package/dist/request/StoreInCache.d.ts +8 -8
- package/dist/response/AuthenticationResult.d.ts +41 -41
- package/dist/response/AuthorizationCodePayload.d.ts +13 -13
- package/dist/response/DeviceCodeResponse.d.ts +25 -25
- package/dist/response/ExternalTokenResponse.d.ts +15 -15
- package/dist/response/IMDSBadResponse.d.ts +4 -4
- package/dist/response/ResponseHandler.d.ts +67 -67
- package/dist/response/ResponseHandler.mjs +311 -311
- package/dist/response/ServerAuthorizationCodeResponse.d.ts +25 -25
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +46 -46
- package/dist/telemetry/performance/IPerformanceClient.d.ts +51 -51
- package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
- package/dist/telemetry/performance/PerformanceClient.d.ts +191 -191
- package/dist/telemetry/performance/PerformanceClient.mjs +409 -409
- package/dist/telemetry/performance/PerformanceEvent.d.ts +441 -433
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +242 -234
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +24 -24
- package/dist/telemetry/performance/StubPerformanceClient.mjs +76 -76
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +66 -66
- package/dist/telemetry/server/ServerTelemetryManager.mjs +197 -197
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
- package/dist/url/IUri.d.ts +12 -12
- package/dist/url/UrlString.d.ts +83 -83
- package/dist/url/UrlString.mjs +279 -279
- package/dist/utils/Constants.d.ts +366 -366
- package/dist/utils/Constants.mjs +376 -376
- package/dist/utils/FunctionWrappers.d.ts +27 -27
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +84 -85
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/MsalTypes.d.ts +6 -6
- package/dist/utils/ProtocolUtils.d.ts +42 -42
- package/dist/utils/ProtocolUtils.mjs +69 -69
- package/dist/utils/StringUtils.d.ts +40 -40
- package/dist/utils/StringUtils.mjs +95 -95
- package/dist/utils/TimeUtils.d.ts +27 -27
- package/dist/utils/TimeUtils.mjs +45 -45
- package/package.json +1 -1
- package/src/account/AccountInfo.ts +0 -1
- package/src/cache/CacheManager.ts +96 -18
- package/src/cache/utils/CacheTypes.ts +6 -6
- package/src/client/AuthorizationCodeClient.ts +3 -1
- package/src/client/RefreshTokenClient.ts +19 -2
- package/src/crypto/ICrypto.ts +0 -7
- package/src/index.ts +1 -0
- package/src/packageMetadata.ts +1 -1
- package/src/request/CommonRefreshTokenRequest.ts +3 -0
- package/src/request/CommonSilentFlowRequest.ts +2 -0
- package/src/telemetry/performance/PerformanceEvent.ts +9 -0
- package/src/utils/FunctionWrappers.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheManager.mjs","sources":["../../src/cache/CacheManager.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.invalidCacheRecord","ClientAuthErrorCodes.bindingKeyNotRemoved"],"mappings":";;;;;;;;;;AAKA;AAQA;AAWA;AACA;AAWA;AAEA;AACA;AACA;AACO,MAAE;AAET,IAAA,WAAS,CAAA,QAAc,EAAA;AAEvB,QAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;;;AAGG,KAAA;AACH;AACI;AACA
|
|
1
|
+
{"version":3,"file":"CacheManager.mjs","sources":["../../src/cache/CacheManager.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.invalidCacheRecord","ClientAuthErrorCodes.bindingKeyNotRemoved"],"mappings":";;;;;;;;;;AAKA;AAQA;AAWA;AACA;AAWA;AAEA;AACA;AACA;AACO,MAAE;AAET,IAAA,WAAS,CAAA,QAAc,EAAA;AAEvB,QAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;;;AAGG,KAAA;AACH;AACI;AACA;;;AAUA,IAAA,cAAA,CAAA,aAAA,EAAA;;;AAGG,gBAAA,OAAA,aAAA,CAAA,cAAA,EAAA,CAAA;aACM;AAET,SAAA;;;AAGG,YAAA,OAAA,EAAA,CAAA;AACH,SAAA;AAEA,QAAA,MAAA,eAAA,GAAA,cAAA,CAAA,MAAA,CAAA,CAAA,QAAA,EAAA,GAAA,KAAA;;;AAGG,gBAAA,OAAA,QAAA,CAAA;aACM;AAET,YAAA,QAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA;;;AAGG,QAAA,MAAA,WAAA,GAAA,eAAA,CAAA,GAAA,CAAA,CAAA,aAAA,KAAA;AACH,YAAQ,OAAqB,IAAA,CAAA,wBAAU,CAAA,aAAoB,CAAA,CAAA;AAE3D,SAAA,CAAA,CAAA;;;AAGG;;AAKH;;;AAGG,QAAA,IAAA,WAAA,CAAA,MAAA,GAAA,CAAA,EAAA;AACH,YAAQ,OAAyB,IAAA,CAAA,yBAAY,WAAE,CAAA,CAAA,CAAA,CAAA,CAAA;AAE/C,SAAA;;;AAGG,SAAA;KACK;AAIR,IAAA,wBAAA,CAAA,aAAA,EAAA;;;AAGG,QAAA,IAAA,OAAA,EAAA;AACH,YAAQ,WAA0B,CAAA,OAAA,GAAA;AAElC,YAAA,WAAA,CAAA,aAAA,GAAA,kBAAA,CAAA,OAAA,CAAA,MAAA,EAAA,IAAA,CAAA,UAAA,CAAA,YAAA,CAAA,CAAA;;;AAGG,KAAA;;AAGH;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;;;;;"}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { CredentialEntity } from "./CredentialEntity";
|
|
2
|
-
import { AuthenticationScheme } from "../../utils/Constants";
|
|
3
|
-
import { ICrypto } from "../../crypto/ICrypto";
|
|
4
|
-
/**
|
|
5
|
-
* ACCESS_TOKEN Credential Type
|
|
6
|
-
*
|
|
7
|
-
* Key:Value Schema:
|
|
8
|
-
*
|
|
9
|
-
* Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read
|
|
10
|
-
*
|
|
11
|
-
* Value Schema:
|
|
12
|
-
* {
|
|
13
|
-
* homeAccountId: home account identifier for the auth scheme,
|
|
14
|
-
* environment: entity that issued the token, represented as a full host
|
|
15
|
-
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
16
|
-
* clientId: client ID of the application
|
|
17
|
-
* secret: Actual credential as a string
|
|
18
|
-
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
19
|
-
* realm: Full tenant or organizational identifier that the account belongs to
|
|
20
|
-
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
21
|
-
* cachedAt: Absolute device time when entry was created in the cache.
|
|
22
|
-
* expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.
|
|
23
|
-
* extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.
|
|
24
|
-
* keyId: used for POP and SSH tokenTypes
|
|
25
|
-
* tokenType: Type of the token issued. Usually "Bearer"
|
|
26
|
-
* }
|
|
27
|
-
*/
|
|
28
|
-
export declare class AccessTokenEntity extends CredentialEntity {
|
|
29
|
-
realm: string;
|
|
30
|
-
target: string;
|
|
31
|
-
cachedAt: string;
|
|
32
|
-
expiresOn: string;
|
|
33
|
-
extendedExpiresOn?: string;
|
|
34
|
-
refreshOn?: string;
|
|
35
|
-
keyId?: string;
|
|
36
|
-
tokenType?: AuthenticationScheme;
|
|
37
|
-
requestedClaims?: string;
|
|
38
|
-
requestedClaimsHash?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Create AccessTokenEntity
|
|
41
|
-
* @param homeAccountId
|
|
42
|
-
* @param environment
|
|
43
|
-
* @param accessToken
|
|
44
|
-
* @param clientId
|
|
45
|
-
* @param tenantId
|
|
46
|
-
* @param scopes
|
|
47
|
-
* @param expiresOn
|
|
48
|
-
* @param extExpiresOn
|
|
49
|
-
*/
|
|
50
|
-
static createAccessTokenEntity(homeAccountId: string, environment: string, accessToken: string, clientId: string, tenantId: string, scopes: string, expiresOn: number, extExpiresOn: number, cryptoUtils: ICrypto, refreshOn?: number, tokenType?: AuthenticationScheme, userAssertionHash?: string, keyId?: string, requestedClaims?: string, requestedClaimsHash?: string): AccessTokenEntity;
|
|
51
|
-
/**
|
|
52
|
-
* Validates an entity: checks for all expected params
|
|
53
|
-
* @param entity
|
|
54
|
-
*/
|
|
55
|
-
static isAccessTokenEntity(entity: object): boolean;
|
|
56
|
-
}
|
|
1
|
+
import { CredentialEntity } from "./CredentialEntity";
|
|
2
|
+
import { AuthenticationScheme } from "../../utils/Constants";
|
|
3
|
+
import { ICrypto } from "../../crypto/ICrypto";
|
|
4
|
+
/**
|
|
5
|
+
* ACCESS_TOKEN Credential Type
|
|
6
|
+
*
|
|
7
|
+
* Key:Value Schema:
|
|
8
|
+
*
|
|
9
|
+
* Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read
|
|
10
|
+
*
|
|
11
|
+
* Value Schema:
|
|
12
|
+
* {
|
|
13
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
14
|
+
* environment: entity that issued the token, represented as a full host
|
|
15
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
16
|
+
* clientId: client ID of the application
|
|
17
|
+
* secret: Actual credential as a string
|
|
18
|
+
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
19
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
20
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
21
|
+
* cachedAt: Absolute device time when entry was created in the cache.
|
|
22
|
+
* expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.
|
|
23
|
+
* extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.
|
|
24
|
+
* keyId: used for POP and SSH tokenTypes
|
|
25
|
+
* tokenType: Type of the token issued. Usually "Bearer"
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
export declare class AccessTokenEntity extends CredentialEntity {
|
|
29
|
+
realm: string;
|
|
30
|
+
target: string;
|
|
31
|
+
cachedAt: string;
|
|
32
|
+
expiresOn: string;
|
|
33
|
+
extendedExpiresOn?: string;
|
|
34
|
+
refreshOn?: string;
|
|
35
|
+
keyId?: string;
|
|
36
|
+
tokenType?: AuthenticationScheme;
|
|
37
|
+
requestedClaims?: string;
|
|
38
|
+
requestedClaimsHash?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Create AccessTokenEntity
|
|
41
|
+
* @param homeAccountId
|
|
42
|
+
* @param environment
|
|
43
|
+
* @param accessToken
|
|
44
|
+
* @param clientId
|
|
45
|
+
* @param tenantId
|
|
46
|
+
* @param scopes
|
|
47
|
+
* @param expiresOn
|
|
48
|
+
* @param extExpiresOn
|
|
49
|
+
*/
|
|
50
|
+
static createAccessTokenEntity(homeAccountId: string, environment: string, accessToken: string, clientId: string, tenantId: string, scopes: string, expiresOn: number, extExpiresOn: number, cryptoUtils: ICrypto, refreshOn?: number, tokenType?: AuthenticationScheme, userAssertionHash?: string, keyId?: string, requestedClaims?: string, requestedClaimsHash?: string): AccessTokenEntity;
|
|
51
|
+
/**
|
|
52
|
+
* Validates an entity: checks for all expected params
|
|
53
|
+
* @param entity
|
|
54
|
+
*/
|
|
55
|
+
static isAccessTokenEntity(entity: object): boolean;
|
|
56
|
+
}
|
|
57
57
|
//# sourceMappingURL=AccessTokenEntity.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.1.0
|
|
1
|
+
/*! @azure/msal-common v14.1.0 2023-10-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { CredentialEntity } from './CredentialEntity.mjs';
|
|
4
4
|
import { CredentialType, AuthenticationScheme } from '../../utils/Constants.mjs';
|
|
@@ -7,114 +7,114 @@ import { createClientAuthError } from '../../error/ClientAuthError.mjs';
|
|
|
7
7
|
import { extractTokenClaims } from '../../account/AuthToken.mjs';
|
|
8
8
|
import { tokenClaimsCnfRequiredForSignedJwt } from '../../error/ClientAuthErrorCodes.mjs';
|
|
9
9
|
|
|
10
|
-
/*
|
|
11
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
|
-
* Licensed under the MIT License.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* ACCESS_TOKEN Credential Type
|
|
16
|
-
*
|
|
17
|
-
* Key:Value Schema:
|
|
18
|
-
*
|
|
19
|
-
* Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read
|
|
20
|
-
*
|
|
21
|
-
* Value Schema:
|
|
22
|
-
* {
|
|
23
|
-
* homeAccountId: home account identifier for the auth scheme,
|
|
24
|
-
* environment: entity that issued the token, represented as a full host
|
|
25
|
-
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
26
|
-
* clientId: client ID of the application
|
|
27
|
-
* secret: Actual credential as a string
|
|
28
|
-
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
29
|
-
* realm: Full tenant or organizational identifier that the account belongs to
|
|
30
|
-
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
31
|
-
* cachedAt: Absolute device time when entry was created in the cache.
|
|
32
|
-
* expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.
|
|
33
|
-
* extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.
|
|
34
|
-
* keyId: used for POP and SSH tokenTypes
|
|
35
|
-
* tokenType: Type of the token issued. Usually "Bearer"
|
|
36
|
-
* }
|
|
37
|
-
*/
|
|
38
|
-
class AccessTokenEntity extends CredentialEntity {
|
|
39
|
-
/**
|
|
40
|
-
* Create AccessTokenEntity
|
|
41
|
-
* @param homeAccountId
|
|
42
|
-
* @param environment
|
|
43
|
-
* @param accessToken
|
|
44
|
-
* @param clientId
|
|
45
|
-
* @param tenantId
|
|
46
|
-
* @param scopes
|
|
47
|
-
* @param expiresOn
|
|
48
|
-
* @param extExpiresOn
|
|
49
|
-
*/
|
|
50
|
-
static createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {
|
|
51
|
-
const atEntity = new AccessTokenEntity();
|
|
52
|
-
atEntity.homeAccountId = homeAccountId;
|
|
53
|
-
atEntity.credentialType = CredentialType.ACCESS_TOKEN;
|
|
54
|
-
atEntity.secret = accessToken;
|
|
55
|
-
const currentTime = TimeUtils.nowSeconds();
|
|
56
|
-
atEntity.cachedAt = currentTime.toString();
|
|
57
|
-
/*
|
|
58
|
-
* Token expiry time.
|
|
59
|
-
* This value should be calculated based on the current UTC time measured locally and the value expires_in Represented as a string in JSON.
|
|
60
|
-
*/
|
|
61
|
-
atEntity.expiresOn = expiresOn.toString();
|
|
62
|
-
atEntity.extendedExpiresOn = extExpiresOn.toString();
|
|
63
|
-
if (refreshOn) {
|
|
64
|
-
atEntity.refreshOn = refreshOn.toString();
|
|
65
|
-
}
|
|
66
|
-
atEntity.environment = environment;
|
|
67
|
-
atEntity.clientId = clientId;
|
|
68
|
-
atEntity.realm = tenantId;
|
|
69
|
-
atEntity.target = scopes;
|
|
70
|
-
atEntity.userAssertionHash = userAssertionHash;
|
|
71
|
-
atEntity.tokenType = tokenType || AuthenticationScheme.BEARER;
|
|
72
|
-
if (requestedClaims) {
|
|
73
|
-
atEntity.requestedClaims = requestedClaims;
|
|
74
|
-
atEntity.requestedClaimsHash = requestedClaimsHash;
|
|
75
|
-
}
|
|
76
|
-
/*
|
|
77
|
-
* Create Access Token With Auth Scheme instead of regular access token
|
|
78
|
-
* Cast to lower to handle "bearer" from ADFS
|
|
79
|
-
*/
|
|
80
|
-
if (atEntity.tokenType?.toLowerCase() !==
|
|
81
|
-
AuthenticationScheme.BEARER.toLowerCase()) {
|
|
82
|
-
atEntity.credentialType =
|
|
83
|
-
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
84
|
-
switch (atEntity.tokenType) {
|
|
85
|
-
case AuthenticationScheme.POP:
|
|
86
|
-
// Make sure keyId is present and add it to credential
|
|
87
|
-
const tokenClaims = extractTokenClaims(accessToken, cryptoUtils.base64Decode);
|
|
88
|
-
if (!tokenClaims?.cnf?.kid) {
|
|
89
|
-
throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
|
|
90
|
-
}
|
|
91
|
-
atEntity.keyId = tokenClaims.cnf.kid;
|
|
92
|
-
break;
|
|
93
|
-
case AuthenticationScheme.SSH:
|
|
94
|
-
atEntity.keyId = keyId;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return atEntity;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Validates an entity: checks for all expected params
|
|
101
|
-
* @param entity
|
|
102
|
-
*/
|
|
103
|
-
static isAccessTokenEntity(entity) {
|
|
104
|
-
if (!entity) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
return (entity.hasOwnProperty("homeAccountId") &&
|
|
108
|
-
entity.hasOwnProperty("environment") &&
|
|
109
|
-
entity.hasOwnProperty("credentialType") &&
|
|
110
|
-
entity.hasOwnProperty("realm") &&
|
|
111
|
-
entity.hasOwnProperty("clientId") &&
|
|
112
|
-
entity.hasOwnProperty("secret") &&
|
|
113
|
-
entity.hasOwnProperty("target") &&
|
|
114
|
-
(entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
|
|
115
|
-
entity["credentialType"] ===
|
|
116
|
-
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
|
|
117
|
-
}
|
|
10
|
+
/*
|
|
11
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
|
+
* Licensed under the MIT License.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* ACCESS_TOKEN Credential Type
|
|
16
|
+
*
|
|
17
|
+
* Key:Value Schema:
|
|
18
|
+
*
|
|
19
|
+
* Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read
|
|
20
|
+
*
|
|
21
|
+
* Value Schema:
|
|
22
|
+
* {
|
|
23
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
24
|
+
* environment: entity that issued the token, represented as a full host
|
|
25
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
26
|
+
* clientId: client ID of the application
|
|
27
|
+
* secret: Actual credential as a string
|
|
28
|
+
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
29
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
30
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
31
|
+
* cachedAt: Absolute device time when entry was created in the cache.
|
|
32
|
+
* expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.
|
|
33
|
+
* extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.
|
|
34
|
+
* keyId: used for POP and SSH tokenTypes
|
|
35
|
+
* tokenType: Type of the token issued. Usually "Bearer"
|
|
36
|
+
* }
|
|
37
|
+
*/
|
|
38
|
+
class AccessTokenEntity extends CredentialEntity {
|
|
39
|
+
/**
|
|
40
|
+
* Create AccessTokenEntity
|
|
41
|
+
* @param homeAccountId
|
|
42
|
+
* @param environment
|
|
43
|
+
* @param accessToken
|
|
44
|
+
* @param clientId
|
|
45
|
+
* @param tenantId
|
|
46
|
+
* @param scopes
|
|
47
|
+
* @param expiresOn
|
|
48
|
+
* @param extExpiresOn
|
|
49
|
+
*/
|
|
50
|
+
static createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {
|
|
51
|
+
const atEntity = new AccessTokenEntity();
|
|
52
|
+
atEntity.homeAccountId = homeAccountId;
|
|
53
|
+
atEntity.credentialType = CredentialType.ACCESS_TOKEN;
|
|
54
|
+
atEntity.secret = accessToken;
|
|
55
|
+
const currentTime = TimeUtils.nowSeconds();
|
|
56
|
+
atEntity.cachedAt = currentTime.toString();
|
|
57
|
+
/*
|
|
58
|
+
* Token expiry time.
|
|
59
|
+
* This value should be calculated based on the current UTC time measured locally and the value expires_in Represented as a string in JSON.
|
|
60
|
+
*/
|
|
61
|
+
atEntity.expiresOn = expiresOn.toString();
|
|
62
|
+
atEntity.extendedExpiresOn = extExpiresOn.toString();
|
|
63
|
+
if (refreshOn) {
|
|
64
|
+
atEntity.refreshOn = refreshOn.toString();
|
|
65
|
+
}
|
|
66
|
+
atEntity.environment = environment;
|
|
67
|
+
atEntity.clientId = clientId;
|
|
68
|
+
atEntity.realm = tenantId;
|
|
69
|
+
atEntity.target = scopes;
|
|
70
|
+
atEntity.userAssertionHash = userAssertionHash;
|
|
71
|
+
atEntity.tokenType = tokenType || AuthenticationScheme.BEARER;
|
|
72
|
+
if (requestedClaims) {
|
|
73
|
+
atEntity.requestedClaims = requestedClaims;
|
|
74
|
+
atEntity.requestedClaimsHash = requestedClaimsHash;
|
|
75
|
+
}
|
|
76
|
+
/*
|
|
77
|
+
* Create Access Token With Auth Scheme instead of regular access token
|
|
78
|
+
* Cast to lower to handle "bearer" from ADFS
|
|
79
|
+
*/
|
|
80
|
+
if (atEntity.tokenType?.toLowerCase() !==
|
|
81
|
+
AuthenticationScheme.BEARER.toLowerCase()) {
|
|
82
|
+
atEntity.credentialType =
|
|
83
|
+
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
84
|
+
switch (atEntity.tokenType) {
|
|
85
|
+
case AuthenticationScheme.POP:
|
|
86
|
+
// Make sure keyId is present and add it to credential
|
|
87
|
+
const tokenClaims = extractTokenClaims(accessToken, cryptoUtils.base64Decode);
|
|
88
|
+
if (!tokenClaims?.cnf?.kid) {
|
|
89
|
+
throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
|
|
90
|
+
}
|
|
91
|
+
atEntity.keyId = tokenClaims.cnf.kid;
|
|
92
|
+
break;
|
|
93
|
+
case AuthenticationScheme.SSH:
|
|
94
|
+
atEntity.keyId = keyId;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return atEntity;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Validates an entity: checks for all expected params
|
|
101
|
+
* @param entity
|
|
102
|
+
*/
|
|
103
|
+
static isAccessTokenEntity(entity) {
|
|
104
|
+
if (!entity) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
return (entity.hasOwnProperty("homeAccountId") &&
|
|
108
|
+
entity.hasOwnProperty("environment") &&
|
|
109
|
+
entity.hasOwnProperty("credentialType") &&
|
|
110
|
+
entity.hasOwnProperty("realm") &&
|
|
111
|
+
entity.hasOwnProperty("clientId") &&
|
|
112
|
+
entity.hasOwnProperty("secret") &&
|
|
113
|
+
entity.hasOwnProperty("target") &&
|
|
114
|
+
(entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
|
|
115
|
+
entity["credentialType"] ===
|
|
116
|
+
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
|
|
117
|
+
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
export { AccessTokenEntity };
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import { Authority } from "../../authority/Authority";
|
|
2
|
-
import { ICrypto } from "../../crypto/ICrypto";
|
|
3
|
-
import { AccountInfo } from "../../account/AccountInfo";
|
|
4
|
-
import { AuthorityType } from "../../authority/AuthorityType";
|
|
5
|
-
import { Logger } from "../../logger/Logger";
|
|
6
|
-
import { TokenClaims } from "../../account/TokenClaims";
|
|
7
|
-
/**
|
|
8
|
-
* Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).
|
|
9
|
-
*
|
|
10
|
-
* Key : Value Schema
|
|
11
|
-
*
|
|
12
|
-
* Key: <home_account_id>-<environment>-<realm*>
|
|
13
|
-
*
|
|
14
|
-
* Value Schema:
|
|
15
|
-
* {
|
|
16
|
-
* homeAccountId: home account identifier for the auth scheme,
|
|
17
|
-
* environment: entity that issued the token, represented as a full host
|
|
18
|
-
* realm: Full tenant or organizational identifier that the account belongs to
|
|
19
|
-
* localAccountId: Original tenant-specific accountID, usually used for legacy cases
|
|
20
|
-
* username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt
|
|
21
|
-
* authorityType: Accounts authority type as a string
|
|
22
|
-
* name: Full name for the account, including given name and family name,
|
|
23
|
-
* lastModificationTime: last time this entity was modified in the cache
|
|
24
|
-
* lastModificationApp:
|
|
25
|
-
* idTokenClaims: Object containing claims parsed from ID token
|
|
26
|
-
* nativeAccountId: Account identifier on the native device
|
|
27
|
-
* }
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export declare class AccountEntity {
|
|
31
|
-
homeAccountId: string;
|
|
32
|
-
environment: string;
|
|
33
|
-
realm: string;
|
|
34
|
-
localAccountId: string;
|
|
35
|
-
username: string;
|
|
36
|
-
authorityType: string;
|
|
37
|
-
clientInfo?: string;
|
|
38
|
-
name?: string;
|
|
39
|
-
lastModificationTime?: string;
|
|
40
|
-
lastModificationApp?: string;
|
|
41
|
-
cloudGraphHostName?: string;
|
|
42
|
-
msGraphHost?: string;
|
|
43
|
-
idTokenClaims?: TokenClaims;
|
|
44
|
-
nativeAccountId?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
47
|
-
*/
|
|
48
|
-
generateAccountId(): string;
|
|
49
|
-
/**
|
|
50
|
-
* Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>
|
|
51
|
-
*/
|
|
52
|
-
generateAccountKey(): string;
|
|
53
|
-
/**
|
|
54
|
-
* Returns the AccountInfo interface for this account.
|
|
55
|
-
*/
|
|
56
|
-
getAccountInfo(): AccountInfo;
|
|
57
|
-
/**
|
|
58
|
-
* Generates account key from interface
|
|
59
|
-
* @param accountInterface
|
|
60
|
-
*/
|
|
61
|
-
static generateAccountCacheKey(accountInterface: AccountInfo): string;
|
|
62
|
-
/**
|
|
63
|
-
* Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.
|
|
64
|
-
* @param accountDetails
|
|
65
|
-
*/
|
|
66
|
-
static createAccount(accountDetails: {
|
|
67
|
-
homeAccountId: string;
|
|
68
|
-
idTokenClaims: TokenClaims;
|
|
69
|
-
clientInfo?: string;
|
|
70
|
-
cloudGraphHostName?: string;
|
|
71
|
-
msGraphHost?: string;
|
|
72
|
-
environment?: string;
|
|
73
|
-
nativeAccountId?: string;
|
|
74
|
-
}, authority: Authority): AccountEntity;
|
|
75
|
-
/**
|
|
76
|
-
* Creates an AccountEntity object from AccountInfo
|
|
77
|
-
* @param accountInfo
|
|
78
|
-
* @param cloudGraphHostName
|
|
79
|
-
* @param msGraphHost
|
|
80
|
-
* @returns
|
|
81
|
-
*/
|
|
82
|
-
static createFromAccountInfo(accountInfo: AccountInfo, cloudGraphHostName?: string, msGraphHost?: string): AccountEntity;
|
|
83
|
-
/**
|
|
84
|
-
* Generate HomeAccountId from server response
|
|
85
|
-
* @param serverClientInfo
|
|
86
|
-
* @param authType
|
|
87
|
-
*/
|
|
88
|
-
static generateHomeAccountId(serverClientInfo: string, authType: AuthorityType, logger: Logger, cryptoObj: ICrypto, idTokenClaims?: TokenClaims): string;
|
|
89
|
-
/**
|
|
90
|
-
* Validates an entity: checks for all expected params
|
|
91
|
-
* @param entity
|
|
92
|
-
*/
|
|
93
|
-
static isAccountEntity(entity: object): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Helper function to determine whether 2 accountInfo objects represent the same account
|
|
96
|
-
* @param accountA
|
|
97
|
-
* @param accountB
|
|
98
|
-
* @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality
|
|
99
|
-
*/
|
|
100
|
-
static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean;
|
|
101
|
-
}
|
|
1
|
+
import { Authority } from "../../authority/Authority";
|
|
2
|
+
import { ICrypto } from "../../crypto/ICrypto";
|
|
3
|
+
import { AccountInfo } from "../../account/AccountInfo";
|
|
4
|
+
import { AuthorityType } from "../../authority/AuthorityType";
|
|
5
|
+
import { Logger } from "../../logger/Logger";
|
|
6
|
+
import { TokenClaims } from "../../account/TokenClaims";
|
|
7
|
+
/**
|
|
8
|
+
* Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).
|
|
9
|
+
*
|
|
10
|
+
* Key : Value Schema
|
|
11
|
+
*
|
|
12
|
+
* Key: <home_account_id>-<environment>-<realm*>
|
|
13
|
+
*
|
|
14
|
+
* Value Schema:
|
|
15
|
+
* {
|
|
16
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
17
|
+
* environment: entity that issued the token, represented as a full host
|
|
18
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
19
|
+
* localAccountId: Original tenant-specific accountID, usually used for legacy cases
|
|
20
|
+
* username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt
|
|
21
|
+
* authorityType: Accounts authority type as a string
|
|
22
|
+
* name: Full name for the account, including given name and family name,
|
|
23
|
+
* lastModificationTime: last time this entity was modified in the cache
|
|
24
|
+
* lastModificationApp:
|
|
25
|
+
* idTokenClaims: Object containing claims parsed from ID token
|
|
26
|
+
* nativeAccountId: Account identifier on the native device
|
|
27
|
+
* }
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare class AccountEntity {
|
|
31
|
+
homeAccountId: string;
|
|
32
|
+
environment: string;
|
|
33
|
+
realm: string;
|
|
34
|
+
localAccountId: string;
|
|
35
|
+
username: string;
|
|
36
|
+
authorityType: string;
|
|
37
|
+
clientInfo?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
lastModificationTime?: string;
|
|
40
|
+
lastModificationApp?: string;
|
|
41
|
+
cloudGraphHostName?: string;
|
|
42
|
+
msGraphHost?: string;
|
|
43
|
+
idTokenClaims?: TokenClaims;
|
|
44
|
+
nativeAccountId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
47
|
+
*/
|
|
48
|
+
generateAccountId(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>
|
|
51
|
+
*/
|
|
52
|
+
generateAccountKey(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the AccountInfo interface for this account.
|
|
55
|
+
*/
|
|
56
|
+
getAccountInfo(): AccountInfo;
|
|
57
|
+
/**
|
|
58
|
+
* Generates account key from interface
|
|
59
|
+
* @param accountInterface
|
|
60
|
+
*/
|
|
61
|
+
static generateAccountCacheKey(accountInterface: AccountInfo): string;
|
|
62
|
+
/**
|
|
63
|
+
* Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.
|
|
64
|
+
* @param accountDetails
|
|
65
|
+
*/
|
|
66
|
+
static createAccount(accountDetails: {
|
|
67
|
+
homeAccountId: string;
|
|
68
|
+
idTokenClaims: TokenClaims;
|
|
69
|
+
clientInfo?: string;
|
|
70
|
+
cloudGraphHostName?: string;
|
|
71
|
+
msGraphHost?: string;
|
|
72
|
+
environment?: string;
|
|
73
|
+
nativeAccountId?: string;
|
|
74
|
+
}, authority: Authority): AccountEntity;
|
|
75
|
+
/**
|
|
76
|
+
* Creates an AccountEntity object from AccountInfo
|
|
77
|
+
* @param accountInfo
|
|
78
|
+
* @param cloudGraphHostName
|
|
79
|
+
* @param msGraphHost
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
static createFromAccountInfo(accountInfo: AccountInfo, cloudGraphHostName?: string, msGraphHost?: string): AccountEntity;
|
|
83
|
+
/**
|
|
84
|
+
* Generate HomeAccountId from server response
|
|
85
|
+
* @param serverClientInfo
|
|
86
|
+
* @param authType
|
|
87
|
+
*/
|
|
88
|
+
static generateHomeAccountId(serverClientInfo: string, authType: AuthorityType, logger: Logger, cryptoObj: ICrypto, idTokenClaims?: TokenClaims): string;
|
|
89
|
+
/**
|
|
90
|
+
* Validates an entity: checks for all expected params
|
|
91
|
+
* @param entity
|
|
92
|
+
*/
|
|
93
|
+
static isAccountEntity(entity: object): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Helper function to determine whether 2 accountInfo objects represent the same account
|
|
96
|
+
* @param accountA
|
|
97
|
+
* @param accountB
|
|
98
|
+
* @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality
|
|
99
|
+
*/
|
|
100
|
+
static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean;
|
|
101
|
+
}
|
|
102
102
|
//# sourceMappingURL=AccountEntity.d.ts.map
|