@azure/msal-common 7.0.0 → 7.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/_virtual/_tslib.js +1 -1
- package/dist/account/AuthToken.js +1 -1
- package/dist/account/CcsCredential.js +1 -1
- package/dist/account/ClientInfo.js +1 -1
- package/dist/authority/Authority.d.ts +20 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +108 -35
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.js +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +623 -0
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -0
- package/dist/authority/AuthorityMetadata.js +12 -0
- package/dist/authority/AuthorityMetadata.js.map +1 -0
- package/dist/authority/AuthorityOptions.d.ts +1 -0
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.js +1 -1
- package/dist/authority/AuthorityOptions.js.map +1 -1
- package/dist/authority/AuthorityType.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts +1 -0
- package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.js +3 -2
- package/dist/authority/OpenIdConfigResponse.js.map +1 -1
- package/dist/authority/ProtocolMode.js +1 -1
- package/dist/authority/RegionDiscovery.js +1 -1
- package/dist/cache/CacheManager.js +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +1 -1
- package/dist/cache/entities/AccountEntity.js +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +1 -0
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +4 -2
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
- package/dist/cache/entities/CacheRecord.js +1 -1
- package/dist/cache/entities/CredentialEntity.js +1 -1
- package/dist/cache/entities/IdTokenEntity.js +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
- package/dist/cache/entities/ThrottlingEntity.js +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +1 -1
- package/dist/client/AuthorizationCodeClient.js +1 -1
- package/dist/client/BaseClient.js +1 -1
- package/dist/client/ClientCredentialClient.js +1 -1
- package/dist/client/DeviceCodeClient.js +1 -1
- package/dist/client/OnBehalfOfClient.js +1 -1
- package/dist/client/RefreshTokenClient.js +1 -1
- package/dist/client/SilentFlowClient.js +1 -1
- package/dist/client/UsernamePasswordClient.js +1 -1
- package/dist/config/ClientConfiguration.d.ts +2 -0
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +2 -2
- package/dist/config/ClientConfiguration.js.map +1 -1
- package/dist/crypto/ICrypto.js +1 -1
- package/dist/crypto/JoseHeader.js +1 -1
- package/dist/crypto/PopTokenGenerator.js +1 -1
- package/dist/error/AuthError.js +1 -1
- package/dist/error/ClientAuthError.js +1 -1
- package/dist/error/ClientConfigurationError.js +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +9 -0
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +12 -1
- package/dist/error/InteractionRequiredAuthError.js.map +1 -1
- package/dist/error/JoseHeaderError.js +1 -1
- package/dist/error/ServerError.js +1 -1
- package/dist/index.cjs.js +134 -39
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/logger/Logger.js +1 -1
- package/dist/network/INetworkModule.js +1 -1
- package/dist/network/NetworkManager.js +1 -1
- package/dist/network/ThrottlingUtils.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.js +1 -1
- package/dist/request/RequestParameterBuilder.js +1 -1
- package/dist/request/RequestValidator.js +1 -1
- package/dist/request/ScopeSet.js +1 -1
- package/dist/response/ResponseHandler.js +1 -1
- package/dist/telemetry/performance/PerformanceClient.js +1 -1
- package/dist/telemetry/performance/PerformanceEvent.js +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.js +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
- package/dist/url/UrlString.js +1 -1
- package/dist/utils/Constants.d.ts +2 -1
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +2 -1
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/ProtocolUtils.js +1 -1
- package/dist/utils/StringUtils.js +1 -1
- package/dist/utils/TimeUtils.js +1 -1
- package/package.json +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientConfiguration.js","sources":["../../src/config/ClientConfiguration.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { DEFAULT_CRYPTO_IMPLEMENTATION, ICrypto } from \"../crypto/ICrypto\";\nimport { AuthError } from \"../error/AuthError\";\nimport { ILoggerCallback, LogLevel } from \"../logger/Logger\";\nimport { Constants } from \"../utils/Constants\";\nimport { version } from \"../packageMetadata\";\nimport { Authority } from \"../authority/Authority\";\nimport { AzureCloudInstance } from \"../authority/AuthorityOptions\";\nimport { CacheManager, DefaultStorageClass } from \"../cache/CacheManager\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\nimport { ClientCredentials } from \"../account/ClientCredentials\";\n\n// Token renewal offset default in seconds\nconst DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;\n\n/**\n * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.\n *\n * This object allows you to configure important elements of MSAL functionality:\n * - authOptions - Authentication for application\n * - cryptoInterface - Implementation of crypto functions\n * - libraryInfo - Library metadata\n * - telemetry - Telemetry options and data\n * - loggerOptions - Logging for application\n * - networkInterface - Network implementation\n * - storageInterface - Storage implementation\n * - systemOptions - Additional library options\n * - clientCredentials - Credentials options for confidential clients\n */\nexport type ClientConfiguration = {\n authOptions: AuthOptions,\n systemOptions?: SystemOptions,\n loggerOptions?: LoggerOptions,\n storageInterface?: CacheManager,\n networkInterface?: INetworkModule,\n cryptoInterface?: ICrypto,\n clientCredentials?: ClientCredentials,\n libraryInfo?: LibraryInfo\n telemetry?: TelemetryOptions,\n serverTelemetryManager?: ServerTelemetryManager | null,\n persistencePlugin?: ICachePlugin | null,\n serializableCache?: ISerializableTokenCache | null\n};\n\nexport type CommonClientConfiguration = {\n authOptions: Required<AuthOptions>,\n systemOptions: Required<SystemOptions>,\n loggerOptions : Required<LoggerOptions>,\n storageInterface: CacheManager,\n networkInterface : INetworkModule,\n cryptoInterface : Required<ICrypto>,\n libraryInfo : LibraryInfo,\n telemetry: Required<TelemetryOptions>,\n serverTelemetryManager: ServerTelemetryManager | null,\n clientCredentials: ClientCredentials,\n persistencePlugin: ICachePlugin | null,\n serializableCache: ISerializableTokenCache | null\n};\n\n/**\n * Use this to configure the auth options in the ClientConfiguration object\n *\n * - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\n * - authority - You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\n * - knownAuthorities - An array of URIs that are known to be valid. Used in B2C scenarios.\n * - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.\n * - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\n * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\n */\nexport type AuthOptions = {\n clientId: string;\n authority: Authority;\n clientCapabilities?: Array<string>;\n azureCloudOptions?: AzureCloudOptions;\n};\n\n/**\n * Use this to configure token renewal info in the Configuration object\n *\n * - tokenRenewalOffsetSeconds - Sets the window of offset needed to renew the token before expiry\n */\nexport type SystemOptions = {\n tokenRenewalOffsetSeconds?: number;\n preventCorsPreflight?: boolean;\n proxyUrl?: string;\n};\n\n/**\n * Use this to configure the logging that MSAL does, by configuring logger options in the Configuration object\n *\n * - loggerCallback - Callback for logger\n * - piiLoggingEnabled - Sets whether pii logging is enabled\n * - logLevel - Sets the level at which logging happens\n * - correlationId - Sets the correlationId printed by the logger\n */\nexport type LoggerOptions = {\n loggerCallback?: ILoggerCallback,\n piiLoggingEnabled?: boolean,\n logLevel?: LogLevel,\n correlationId?: string\n};\n\n/**\n * Library-specific options\n */\nexport type LibraryInfo = {\n sku: string,\n version: string,\n cpu: string,\n os: string\n};\n\n/**\n * AzureCloudInstance specific options\n *\n * - azureCloudInstance - string enum providing short notation for soverign and public cloud authorities\n * - tenant - provision to provide the tenant info\n */\nexport type AzureCloudOptions = {\n azureCloudInstance: AzureCloudInstance;\n tenant?: string,\n};\n\nexport type TelemetryOptions = {\n application: ApplicationTelemetry;\n};\n\n/**\n * Telemetry information sent on request\n * - appName: Unique string name of an application\n * - appVersion: Version of the application using MSAL\n */\nexport type ApplicationTelemetry = {\n appName: string;\n appVersion: string;\n};\n\nexport const DEFAULT_SYSTEM_OPTIONS: Required<SystemOptions> = {\n tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,\n preventCorsPreflight: false,\n proxyUrl: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_LOGGER_IMPLEMENTATION: Required<LoggerOptions> = {\n loggerCallback: () => {\n // allow users to not set loggerCallback\n },\n piiLoggingEnabled: false,\n logLevel: LogLevel.Info,\n correlationId: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_NETWORK_IMPLEMENTATION: INetworkModule = {\n async sendGetRequestAsync<T>(): Promise<T> {\n const notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async sendPostRequestAsync<T>(): Promise<T> {\n const notImplErr = \"Network interface - sendPostRequestAsync() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n};\n\nconst DEFAULT_LIBRARY_INFO: LibraryInfo = {\n sku: Constants.SKU,\n version: version,\n cpu: Constants.EMPTY_STRING,\n os: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_CLIENT_CREDENTIALS: ClientCredentials = {\n clientSecret: Constants.EMPTY_STRING,\n clientAssertion: undefined\n};\n\nconst DEFAULT_AZURE_CLOUD_OPTIONS: AzureCloudOptions = {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: `${Constants.DEFAULT_COMMON_TENANT}`\n};\n\nconst DEFAULT_TELEMETRY_OPTIONS: Required<TelemetryOptions> = {\n application: {\n appName: \"\",\n appVersion: \"\"\n }\n};\n\n/**\n * Function that sets the default options when not explicitly configured from app developer\n *\n * @param Configuration\n *\n * @returns Configuration\n */\nexport function buildClientConfiguration(\n {\n authOptions: userAuthOptions,\n systemOptions: userSystemOptions,\n loggerOptions: userLoggerOption,\n storageInterface: storageImplementation,\n networkInterface: networkImplementation,\n cryptoInterface: cryptoImplementation,\n clientCredentials: clientCredentials,\n libraryInfo: libraryInfo,\n telemetry: telemetry,\n serverTelemetryManager: serverTelemetryManager,\n persistencePlugin: persistencePlugin,\n serializableCache: serializableCache\n }: ClientConfiguration): CommonClientConfiguration {\n\n const loggerOptions = { ...DEFAULT_LOGGER_IMPLEMENTATION, ...userLoggerOption };\n\n return {\n authOptions: buildAuthOptions(userAuthOptions),\n systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },\n loggerOptions: loggerOptions,\n storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION),\n networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,\n cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,\n clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,\n libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },\n serverTelemetryManager: serverTelemetryManager || null,\n persistencePlugin: persistencePlugin || null,\n serializableCache: serializableCache || null\n };\n}\n\n/**\n * Construct authoptions from the client and platform passed values\n * @param authOptions\n */\nfunction buildAuthOptions(authOptions: AuthOptions): Required<AuthOptions> {\n return {\n clientCapabilities: [],\n azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,\n ...authOptions\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAmBA;AACA,IAAM,gCAAgC,GAAG,GAAG,CAAC;IA4HhC,sBAAsB,GAA4B;IAC3D,yBAAyB,EAAE,gCAAgC;IAC3D,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,SAAS,CAAC,YAAY;EAClC;AAEF,IAAM,6BAA6B,GAA4B;IAC3D,cAAc,EAAE;;KAEf;IACD,iBAAiB,EAAE,KAAK;IACxB,QAAQ,EAAE,QAAQ,CAAC,IAAI;IACvB,aAAa,EAAE,SAAS,CAAC,YAAY;CACxC,CAAC;AAEF,IAAM,8BAA8B,GAAmB;IAC7C,mBAAmB,EAAzB;;;;gBACU,UAAU,GAAG,oEAAoE,CAAC;gBACxF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,oBAAoB,EAA1B;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;gBACzF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;CACJ,CAAC;AAEF,IAAM,oBAAoB,GAAgB;IACtC,GAAG,EAAE,SAAS,CAAC,GAAG;IAClB,OAAO,EAAE,OAAO;IAChB,GAAG,EAAE,SAAS,CAAC,YAAY;IAC3B,EAAE,EAAE,SAAS,CAAC,YAAY;CAC7B,CAAC;AAEF,IAAM,0BAA0B,GAAsB;IAClD,YAAY,EAAE,SAAS,CAAC,YAAY;IACpC,eAAe,EAAE,SAAS;CAC7B,CAAC;AAEF,IAAM,2BAA2B,GAAsB;IACnD,kBAAkB,EAAE,kBAAkB,CAAC,IAAI;IAC3C,MAAM,EAAE,KAAG,SAAS,CAAC,qBAAuB;CAC/C,CAAC;AAEF,IAAM,yBAAyB,GAA+B;IAC1D,WAAW,EAAE;QACT,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;CACJ,CAAC;AAEF;;;;;;;SAOgB,wBAAwB,CACpC,EAasB;QAZL,eAAe,iBAAA,EACb,iBAAiB,mBAAA,EACjB,gBAAgB,mBAAA,EACb,qBAAqB,sBAAA,EACrB,qBAAqB,sBAAA,EACtB,oBAAoB,qBAAA,EAClB,iBAAiB,uBAAA,EACvB,WAAW,iBAAA,EACb,SAAS,eAAA,EACI,sBAAsB,4BAAA,EAC3B,iBAAiB,uBAAA,EACjB,iBAAiB,uBAAA;IAGxC,IAAM,aAAa,yBAAQ,6BAA6B,GAAK,gBAAgB,CAAE,CAAC;IAEhF,OAAO;QACH,WAAW,EAAE,gBAAgB,CAAC,eAAe,CAAC;QAC9C,aAAa,wBAAO,sBAAsB,GAAK,iBAAiB,CAAE;QAClE,aAAa,EAAE,aAAa;QAC5B,gBAAgB,EAAE,qBAAqB,IAAI,IAAI,mBAAmB,CAAC,eAAe,CAAC,QAAQ,EAAE,6BAA6B,CAAC;QAC3H,gBAAgB,EAAE,qBAAqB,IAAI,8BAA8B;QACzE,eAAe,EAAE,oBAAoB,IAAI,6BAA6B;QACtE,iBAAiB,EAAE,iBAAiB,IAAI,0BAA0B;QAClE,WAAW,wBAAO,oBAAoB,GAAK,WAAW,CAAE;QACxD,SAAS,wBAAO,yBAAyB,GAAK,SAAS,CAAE;QACzD,sBAAsB,EAAE,sBAAsB,IAAI,IAAI;QACtD,iBAAiB,EAAE,iBAAiB,IAAI,IAAI;QAC5C,iBAAiB,EAAE,iBAAiB,IAAI,IAAI;KAC/C,CAAC;AACN,CAAC;AAED;;;;AAIA,SAAS,gBAAgB,CAAC,WAAwB;IAC9C,kBACI,kBAAkB,EAAE,EAAE,EACtB,iBAAiB,EAAE,2BAA2B,IAC3C,WAAW,EAChB;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"ClientConfiguration.js","sources":["../../src/config/ClientConfiguration.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { DEFAULT_CRYPTO_IMPLEMENTATION, ICrypto } from \"../crypto/ICrypto\";\nimport { AuthError } from \"../error/AuthError\";\nimport { ILoggerCallback, LogLevel } from \"../logger/Logger\";\nimport { Constants } from \"../utils/Constants\";\nimport { version } from \"../packageMetadata\";\nimport { Authority } from \"../authority/Authority\";\nimport { AzureCloudInstance } from \"../authority/AuthorityOptions\";\nimport { CacheManager, DefaultStorageClass } from \"../cache/CacheManager\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\nimport { ClientCredentials } from \"../account/ClientCredentials\";\n\n// Token renewal offset default in seconds\nconst DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;\n\n/**\n * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.\n *\n * This object allows you to configure important elements of MSAL functionality:\n * - authOptions - Authentication for application\n * - cryptoInterface - Implementation of crypto functions\n * - libraryInfo - Library metadata\n * - telemetry - Telemetry options and data\n * - loggerOptions - Logging for application\n * - networkInterface - Network implementation\n * - storageInterface - Storage implementation\n * - systemOptions - Additional library options\n * - clientCredentials - Credentials options for confidential clients\n */\nexport type ClientConfiguration = {\n authOptions: AuthOptions,\n systemOptions?: SystemOptions,\n loggerOptions?: LoggerOptions,\n storageInterface?: CacheManager,\n networkInterface?: INetworkModule,\n cryptoInterface?: ICrypto,\n clientCredentials?: ClientCredentials,\n libraryInfo?: LibraryInfo\n telemetry?: TelemetryOptions,\n serverTelemetryManager?: ServerTelemetryManager | null,\n persistencePlugin?: ICachePlugin | null,\n serializableCache?: ISerializableTokenCache | null\n};\n\nexport type CommonClientConfiguration = {\n authOptions: Required<AuthOptions>,\n systemOptions: Required<SystemOptions>,\n loggerOptions : Required<LoggerOptions>,\n storageInterface: CacheManager,\n networkInterface : INetworkModule,\n cryptoInterface : Required<ICrypto>,\n libraryInfo : LibraryInfo,\n telemetry: Required<TelemetryOptions>,\n serverTelemetryManager: ServerTelemetryManager | null,\n clientCredentials: ClientCredentials,\n persistencePlugin: ICachePlugin | null,\n serializableCache: ISerializableTokenCache | null\n};\n\n/**\n * Use this to configure the auth options in the ClientConfiguration object\n *\n * - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\n * - authority - You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\n * - knownAuthorities - An array of URIs that are known to be valid. Used in B2C scenarios.\n * - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.\n * - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\n * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\n * - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.\n */\nexport type AuthOptions = {\n clientId: string;\n authority: Authority;\n clientCapabilities?: Array<string>;\n azureCloudOptions?: AzureCloudOptions;\n skipAuthorityMetadataCache?: boolean;\n};\n\n/**\n * Use this to configure token renewal info in the Configuration object\n *\n * - tokenRenewalOffsetSeconds - Sets the window of offset needed to renew the token before expiry\n */\nexport type SystemOptions = {\n tokenRenewalOffsetSeconds?: number;\n preventCorsPreflight?: boolean;\n proxyUrl?: string;\n};\n\n/**\n * Use this to configure the logging that MSAL does, by configuring logger options in the Configuration object\n *\n * - loggerCallback - Callback for logger\n * - piiLoggingEnabled - Sets whether pii logging is enabled\n * - logLevel - Sets the level at which logging happens\n * - correlationId - Sets the correlationId printed by the logger\n */\nexport type LoggerOptions = {\n loggerCallback?: ILoggerCallback,\n piiLoggingEnabled?: boolean,\n logLevel?: LogLevel,\n correlationId?: string\n};\n\n/**\n * Library-specific options\n */\nexport type LibraryInfo = {\n sku: string,\n version: string,\n cpu: string,\n os: string\n};\n\n/**\n * AzureCloudInstance specific options\n *\n * - azureCloudInstance - string enum providing short notation for soverign and public cloud authorities\n * - tenant - provision to provide the tenant info\n */\nexport type AzureCloudOptions = {\n azureCloudInstance: AzureCloudInstance;\n tenant?: string,\n};\n\nexport type TelemetryOptions = {\n application: ApplicationTelemetry;\n};\n\n/**\n * Telemetry information sent on request\n * - appName: Unique string name of an application\n * - appVersion: Version of the application using MSAL\n */\nexport type ApplicationTelemetry = {\n appName: string;\n appVersion: string;\n};\n\nexport const DEFAULT_SYSTEM_OPTIONS: Required<SystemOptions> = {\n tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,\n preventCorsPreflight: false,\n proxyUrl: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_LOGGER_IMPLEMENTATION: Required<LoggerOptions> = {\n loggerCallback: () => {\n // allow users to not set loggerCallback\n },\n piiLoggingEnabled: false,\n logLevel: LogLevel.Info,\n correlationId: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_NETWORK_IMPLEMENTATION: INetworkModule = {\n async sendGetRequestAsync<T>(): Promise<T> {\n const notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async sendPostRequestAsync<T>(): Promise<T> {\n const notImplErr = \"Network interface - sendPostRequestAsync() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n};\n\nconst DEFAULT_LIBRARY_INFO: LibraryInfo = {\n sku: Constants.SKU,\n version: version,\n cpu: Constants.EMPTY_STRING,\n os: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_CLIENT_CREDENTIALS: ClientCredentials = {\n clientSecret: Constants.EMPTY_STRING,\n clientAssertion: undefined\n};\n\nconst DEFAULT_AZURE_CLOUD_OPTIONS: AzureCloudOptions = {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: `${Constants.DEFAULT_COMMON_TENANT}`\n};\n\nconst DEFAULT_TELEMETRY_OPTIONS: Required<TelemetryOptions> = {\n application: {\n appName: \"\",\n appVersion: \"\"\n }\n};\n\n/**\n * Function that sets the default options when not explicitly configured from app developer\n *\n * @param Configuration\n *\n * @returns Configuration\n */\nexport function buildClientConfiguration(\n {\n authOptions: userAuthOptions,\n systemOptions: userSystemOptions,\n loggerOptions: userLoggerOption,\n storageInterface: storageImplementation,\n networkInterface: networkImplementation,\n cryptoInterface: cryptoImplementation,\n clientCredentials: clientCredentials,\n libraryInfo: libraryInfo,\n telemetry: telemetry,\n serverTelemetryManager: serverTelemetryManager,\n persistencePlugin: persistencePlugin,\n serializableCache: serializableCache\n }: ClientConfiguration): CommonClientConfiguration {\n\n const loggerOptions = { ...DEFAULT_LOGGER_IMPLEMENTATION, ...userLoggerOption };\n\n return {\n authOptions: buildAuthOptions(userAuthOptions),\n systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },\n loggerOptions: loggerOptions,\n storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION),\n networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,\n cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,\n clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,\n libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },\n serverTelemetryManager: serverTelemetryManager || null,\n persistencePlugin: persistencePlugin || null,\n serializableCache: serializableCache || null\n };\n}\n\n/**\n * Construct authoptions from the client and platform passed values\n * @param authOptions\n */\nfunction buildAuthOptions(authOptions: AuthOptions): Required<AuthOptions> {\n return {\n clientCapabilities: [],\n azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,\n skipAuthorityMetadataCache: false,\n ...authOptions\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAmBA;AACA,IAAM,gCAAgC,GAAG,GAAG,CAAC;IA8HhC,sBAAsB,GAA4B;IAC3D,yBAAyB,EAAE,gCAAgC;IAC3D,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,SAAS,CAAC,YAAY;EAClC;AAEF,IAAM,6BAA6B,GAA4B;IAC3D,cAAc,EAAE;;KAEf;IACD,iBAAiB,EAAE,KAAK;IACxB,QAAQ,EAAE,QAAQ,CAAC,IAAI;IACvB,aAAa,EAAE,SAAS,CAAC,YAAY;CACxC,CAAC;AAEF,IAAM,8BAA8B,GAAmB;IAC7C,mBAAmB,EAAzB;;;;gBACU,UAAU,GAAG,oEAAoE,CAAC;gBACxF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,oBAAoB,EAA1B;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;gBACzF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;CACJ,CAAC;AAEF,IAAM,oBAAoB,GAAgB;IACtC,GAAG,EAAE,SAAS,CAAC,GAAG;IAClB,OAAO,EAAE,OAAO;IAChB,GAAG,EAAE,SAAS,CAAC,YAAY;IAC3B,EAAE,EAAE,SAAS,CAAC,YAAY;CAC7B,CAAC;AAEF,IAAM,0BAA0B,GAAsB;IAClD,YAAY,EAAE,SAAS,CAAC,YAAY;IACpC,eAAe,EAAE,SAAS;CAC7B,CAAC;AAEF,IAAM,2BAA2B,GAAsB;IACnD,kBAAkB,EAAE,kBAAkB,CAAC,IAAI;IAC3C,MAAM,EAAE,KAAG,SAAS,CAAC,qBAAuB;CAC/C,CAAC;AAEF,IAAM,yBAAyB,GAA+B;IAC1D,WAAW,EAAE;QACT,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;CACJ,CAAC;AAEF;;;;;;;SAOgB,wBAAwB,CACpC,EAasB;QAZL,eAAe,iBAAA,EACb,iBAAiB,mBAAA,EACjB,gBAAgB,mBAAA,EACb,qBAAqB,sBAAA,EACrB,qBAAqB,sBAAA,EACtB,oBAAoB,qBAAA,EAClB,iBAAiB,uBAAA,EACvB,WAAW,iBAAA,EACb,SAAS,eAAA,EACI,sBAAsB,4BAAA,EAC3B,iBAAiB,uBAAA,EACjB,iBAAiB,uBAAA;IAGxC,IAAM,aAAa,yBAAQ,6BAA6B,GAAK,gBAAgB,CAAE,CAAC;IAEhF,OAAO;QACH,WAAW,EAAE,gBAAgB,CAAC,eAAe,CAAC;QAC9C,aAAa,wBAAO,sBAAsB,GAAK,iBAAiB,CAAE;QAClE,aAAa,EAAE,aAAa;QAC5B,gBAAgB,EAAE,qBAAqB,IAAI,IAAI,mBAAmB,CAAC,eAAe,CAAC,QAAQ,EAAE,6BAA6B,CAAC;QAC3H,gBAAgB,EAAE,qBAAqB,IAAI,8BAA8B;QACzE,eAAe,EAAE,oBAAoB,IAAI,6BAA6B;QACtE,iBAAiB,EAAE,iBAAiB,IAAI,0BAA0B;QAClE,WAAW,wBAAO,oBAAoB,GAAK,WAAW,CAAE;QACxD,SAAS,wBAAO,yBAAyB,GAAK,SAAS,CAAE;QACzD,sBAAsB,EAAE,sBAAsB,IAAI,IAAI;QACtD,iBAAiB,EAAE,iBAAiB,IAAI,IAAI;QAC5C,iBAAiB,EAAE,iBAAiB,IAAI,IAAI;KAC/C,CAAC;AACN,CAAC;AAED;;;;AAIA,SAAS,gBAAgB,CAAC,WAAwB;IAC9C,kBACI,kBAAkB,EAAE,EAAE,EACtB,iBAAiB,EAAE,2BAA2B,EAC9C,0BAA0B,EAAE,KAAK,IAC9B,WAAW,EAChB;AACN;;;;"}
|
package/dist/crypto/ICrypto.js
CHANGED
package/dist/error/AuthError.js
CHANGED
|
@@ -12,6 +12,10 @@ export declare const InteractionRequiredAuthErrorMessage: {
|
|
|
12
12
|
code: string;
|
|
13
13
|
desc: string;
|
|
14
14
|
};
|
|
15
|
+
native_account_unavailable: {
|
|
16
|
+
code: string;
|
|
17
|
+
desc: string;
|
|
18
|
+
};
|
|
15
19
|
};
|
|
16
20
|
/**
|
|
17
21
|
* Error thrown when user interaction is required.
|
|
@@ -29,5 +33,10 @@ export declare class InteractionRequiredAuthError extends AuthError {
|
|
|
29
33
|
* Creates an error thrown when the authorization code required for a token request is null or empty.
|
|
30
34
|
*/
|
|
31
35
|
static createNoTokensFoundError(): InteractionRequiredAuthError;
|
|
36
|
+
/**
|
|
37
|
+
* Creates an error thrown when the native broker returns ACCOUNT_UNAVAILABLE status, indicating that the account was removed and interactive sign-in is required
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
static createNativeAccountUnavailableError(): InteractionRequiredAuthError;
|
|
32
41
|
}
|
|
33
42
|
//# sourceMappingURL=InteractionRequiredAuthError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionRequiredAuthError.d.ts","sourceRoot":"","sources":["../../src/error/InteractionRequiredAuthError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,qCAAqC,UAIjD,CAAC;AAEF,eAAO,MAAM,sCAAsC,UAMlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mCAAmC
|
|
1
|
+
{"version":3,"file":"InteractionRequiredAuthError.d.ts","sourceRoot":"","sources":["../../src/error/InteractionRequiredAuthError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,qCAAqC,UAIjD,CAAC;AAEF,eAAO,MAAM,sCAAsC,UAMlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;CAS/C,CAAC;AAEF;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;gBAE3C,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAOxE;;;;;OAKG;IACH,MAAM,CAAC,0BAA0B,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAI,OAAO;IAUxG;;OAEG;IACH,MAAM,CAAC,wBAAwB,IAAI,4BAA4B;IAI/D;;;OAGG;IACH,MAAM,CAAC,mCAAmC,IAAI,4BAA4B;CAG7E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v7.
|
|
1
|
+
/*! @azure/msal-common v7.1.0 2022-07-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AuthError } from './AuthError.js';
|
|
@@ -29,6 +29,10 @@ var InteractionRequiredAuthErrorMessage = {
|
|
|
29
29
|
noTokensFoundError: {
|
|
30
30
|
code: "no_tokens_found",
|
|
31
31
|
desc: "No refresh token found in the cache. Please sign-in."
|
|
32
|
+
},
|
|
33
|
+
native_account_unavailable: {
|
|
34
|
+
code: "native_account_unavailable",
|
|
35
|
+
desc: "The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."
|
|
32
36
|
}
|
|
33
37
|
};
|
|
34
38
|
/**
|
|
@@ -62,6 +66,13 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
|
|
|
62
66
|
InteractionRequiredAuthError.createNoTokensFoundError = function () {
|
|
63
67
|
return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);
|
|
64
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* Creates an error thrown when the native broker returns ACCOUNT_UNAVAILABLE status, indicating that the account was removed and interactive sign-in is required
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
InteractionRequiredAuthError.createNativeAccountUnavailableError = function () {
|
|
74
|
+
return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.native_account_unavailable.code, InteractionRequiredAuthErrorMessage.native_account_unavailable.desc);
|
|
75
|
+
};
|
|
65
76
|
return InteractionRequiredAuthError;
|
|
66
77
|
}(AuthError));
|
|
67
78
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionRequiredAuthError.js","sources":["../../src/error/InteractionRequiredAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required\n */\nexport const InteractionRequiredServerErrorMessage = [\n \"interaction_required\",\n \"consent_required\",\n \"login_required\"\n];\n\nexport const InteractionRequiredAuthSubErrorMessage = [\n \"message_only\",\n \"additional_action\",\n \"basic_action\",\n \"user_password_expired\",\n \"consent_required\"\n];\n\n/**\n * Interaction required errors defined by the SDK\n */\nexport const InteractionRequiredAuthErrorMessage = {\n noTokensFoundError: {\n code: \"no_tokens_found\",\n desc: \"No refresh token found in the cache. Please sign-in.\"\n }\n};\n\n/**\n * Error thrown when user interaction is required.\n */\nexport class InteractionRequiredAuthError extends AuthError {\n\n constructor(errorCode?: string, errorMessage?: string, subError?: string) {\n super(errorCode, errorMessage, subError);\n this.name = \"InteractionRequiredAuthError\";\n\n Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);\n }\n\n /**\n * Helper function used to determine if an error thrown by the server requires interaction to resolve\n * @param errorCode \n * @param errorString \n * @param subError \n */\n static isInteractionRequiredError(errorCode?: string, errorString?: string, subError?: string) : boolean {\n const isInteractionRequiredErrorCode = !!errorCode && InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;\n const isInteractionRequiredSubError = !!subError && InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;\n const isInteractionRequiredErrorDesc = !!errorString && InteractionRequiredServerErrorMessage.some((irErrorCode) => {\n return errorString.indexOf(irErrorCode) > -1;\n });\n\n return isInteractionRequiredErrorCode || isInteractionRequiredErrorDesc || isInteractionRequiredSubError;\n }\n\n /**\n * Creates an error thrown when the authorization code required for a token request is null or empty.\n */\n static createNoTokensFoundError(): InteractionRequiredAuthError {\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,qCAAqC,GAAG;IACjD,sBAAsB;IACtB,kBAAkB;IAClB,gBAAgB;EAClB;IAEW,sCAAsC,GAAG;IAClD,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,uBAAuB;IACvB,kBAAkB;EACpB;AAEF;;;IAGa,mCAAmC,GAAG;IAC/C,kBAAkB,EAAE;QAChB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,sDAAsD;KAC/D;EACH;AAEF;;;;IAGkD,gDAAS;IAEvD,sCAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB;QAAxE,YACI,kBAAM,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,SAI3C;QAHG,KAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAE3C,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,4BAA4B,CAAC,SAAS,CAAC,CAAC;;KACvE;;;;;;;IAQM,uDAA0B,GAAjC,UAAkC,SAAkB,EAAE,WAAoB,EAAE,QAAiB;QACzF,IAAM,8BAA8B,GAAG,CAAC,CAAC,SAAS,IAAI,qCAAqC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACpH,IAAM,6BAA6B,GAAG,CAAC,CAAC,QAAQ,IAAI,sCAAsC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAClH,IAAM,8BAA8B,GAAG,CAAC,CAAC,WAAW,IAAI,qCAAqC,CAAC,IAAI,CAAC,UAAC,WAAW;YAC3G,OAAO,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;SAChD,CAAC,CAAC;QAEH,OAAO,8BAA8B,IAAI,8BAA8B,IAAI,6BAA6B,CAAC;KAC5G;;;;IAKM,qDAAwB,GAA/B;QACI,OAAO,IAAI,4BAA4B,CAAC,mCAAmC,CAAC,kBAAkB,CAAC,IAAI,EAAE,mCAAmC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KACrK;IACL,mCAAC;AAAD,
|
|
1
|
+
{"version":3,"file":"InteractionRequiredAuthError.js","sources":["../../src/error/InteractionRequiredAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required\n */\nexport const InteractionRequiredServerErrorMessage = [\n \"interaction_required\",\n \"consent_required\",\n \"login_required\"\n];\n\nexport const InteractionRequiredAuthSubErrorMessage = [\n \"message_only\",\n \"additional_action\",\n \"basic_action\",\n \"user_password_expired\",\n \"consent_required\"\n];\n\n/**\n * Interaction required errors defined by the SDK\n */\nexport const InteractionRequiredAuthErrorMessage = {\n noTokensFoundError: {\n code: \"no_tokens_found\",\n desc: \"No refresh token found in the cache. Please sign-in.\"\n },\n native_account_unavailable: {\n code: \"native_account_unavailable\",\n desc: \"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.\"\n }\n};\n\n/**\n * Error thrown when user interaction is required.\n */\nexport class InteractionRequiredAuthError extends AuthError {\n\n constructor(errorCode?: string, errorMessage?: string, subError?: string) {\n super(errorCode, errorMessage, subError);\n this.name = \"InteractionRequiredAuthError\";\n\n Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);\n }\n\n /**\n * Helper function used to determine if an error thrown by the server requires interaction to resolve\n * @param errorCode \n * @param errorString \n * @param subError \n */\n static isInteractionRequiredError(errorCode?: string, errorString?: string, subError?: string) : boolean {\n const isInteractionRequiredErrorCode = !!errorCode && InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;\n const isInteractionRequiredSubError = !!subError && InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;\n const isInteractionRequiredErrorDesc = !!errorString && InteractionRequiredServerErrorMessage.some((irErrorCode) => {\n return errorString.indexOf(irErrorCode) > -1;\n });\n\n return isInteractionRequiredErrorCode || isInteractionRequiredErrorDesc || isInteractionRequiredSubError;\n }\n\n /**\n * Creates an error thrown when the authorization code required for a token request is null or empty.\n */\n static createNoTokensFoundError(): InteractionRequiredAuthError {\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);\n }\n\n /**\n * Creates an error thrown when the native broker returns ACCOUNT_UNAVAILABLE status, indicating that the account was removed and interactive sign-in is required\n * @returns \n */\n static createNativeAccountUnavailableError(): InteractionRequiredAuthError {\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.native_account_unavailable.code, InteractionRequiredAuthErrorMessage.native_account_unavailable.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,qCAAqC,GAAG;IACjD,sBAAsB;IACtB,kBAAkB;IAClB,gBAAgB;EAClB;IAEW,sCAAsC,GAAG;IAClD,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,uBAAuB;IACvB,kBAAkB;EACpB;AAEF;;;IAGa,mCAAmC,GAAG;IAC/C,kBAAkB,EAAE;QAChB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,sDAAsD;KAC/D;IACD,0BAA0B,EAAE;QACxB,IAAI,EAAE,4BAA4B;QAClC,IAAI,EAAE,qJAAqJ;KAC9J;EACH;AAEF;;;;IAGkD,gDAAS;IAEvD,sCAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB;QAAxE,YACI,kBAAM,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,SAI3C;QAHG,KAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAE3C,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,4BAA4B,CAAC,SAAS,CAAC,CAAC;;KACvE;;;;;;;IAQM,uDAA0B,GAAjC,UAAkC,SAAkB,EAAE,WAAoB,EAAE,QAAiB;QACzF,IAAM,8BAA8B,GAAG,CAAC,CAAC,SAAS,IAAI,qCAAqC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACpH,IAAM,6BAA6B,GAAG,CAAC,CAAC,QAAQ,IAAI,sCAAsC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAClH,IAAM,8BAA8B,GAAG,CAAC,CAAC,WAAW,IAAI,qCAAqC,CAAC,IAAI,CAAC,UAAC,WAAW;YAC3G,OAAO,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;SAChD,CAAC,CAAC;QAEH,OAAO,8BAA8B,IAAI,8BAA8B,IAAI,6BAA6B,CAAC;KAC5G;;;;IAKM,qDAAwB,GAA/B;QACI,OAAO,IAAI,4BAA4B,CAAC,mCAAmC,CAAC,kBAAkB,CAAC,IAAI,EAAE,mCAAmC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KACrK;;;;;IAMM,gEAAmC,GAA1C;QACI,OAAO,IAAI,4BAA4B,CAAC,mCAAmC,CAAC,0BAA0B,CAAC,IAAI,EAAE,mCAAmC,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC;KACrL;IACL,mCAAC;AAAD,CAvCA,CAAkD,SAAS;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v7.
|
|
1
|
+
/*! @azure/msal-common v7.1.0 2022-07-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -379,6 +379,7 @@ var AuthorityMetadataSource;
|
|
|
379
379
|
AuthorityMetadataSource["CONFIG"] = "config";
|
|
380
380
|
AuthorityMetadataSource["CACHE"] = "cache";
|
|
381
381
|
AuthorityMetadataSource["NETWORK"] = "network";
|
|
382
|
+
AuthorityMetadataSource["HARDCODED_VALUES"] = "hardcoded_values";
|
|
382
383
|
})(AuthorityMetadataSource || (AuthorityMetadataSource = {}));
|
|
383
384
|
var SERVER_TELEM_CONSTANTS = {
|
|
384
385
|
SCHEMA_VERSION: 5,
|
|
@@ -1357,7 +1358,7 @@ var Logger = /** @class */ (function () {
|
|
|
1357
1358
|
|
|
1358
1359
|
/* eslint-disable header/header */
|
|
1359
1360
|
var name = "@azure/msal-common";
|
|
1360
|
-
var version = "7.
|
|
1361
|
+
var version = "7.1.0";
|
|
1361
1362
|
|
|
1362
1363
|
/*
|
|
1363
1364
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3218,7 +3219,7 @@ function buildClientConfiguration(_a) {
|
|
|
3218
3219
|
* @param authOptions
|
|
3219
3220
|
*/
|
|
3220
3221
|
function buildAuthOptions(authOptions) {
|
|
3221
|
-
return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS }, authOptions);
|
|
3222
|
+
return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
|
|
3222
3223
|
}
|
|
3223
3224
|
|
|
3224
3225
|
/*
|
|
@@ -4251,6 +4252,10 @@ var InteractionRequiredAuthErrorMessage = {
|
|
|
4251
4252
|
noTokensFoundError: {
|
|
4252
4253
|
code: "no_tokens_found",
|
|
4253
4254
|
desc: "No refresh token found in the cache. Please sign-in."
|
|
4255
|
+
},
|
|
4256
|
+
native_account_unavailable: {
|
|
4257
|
+
code: "native_account_unavailable",
|
|
4258
|
+
desc: "The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."
|
|
4254
4259
|
}
|
|
4255
4260
|
};
|
|
4256
4261
|
/**
|
|
@@ -4284,6 +4289,13 @@ var InteractionRequiredAuthError = /** @class */ (function (_super) {
|
|
|
4284
4289
|
InteractionRequiredAuthError.createNoTokensFoundError = function () {
|
|
4285
4290
|
return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);
|
|
4286
4291
|
};
|
|
4292
|
+
/**
|
|
4293
|
+
* Creates an error thrown when the native broker returns ACCOUNT_UNAVAILABLE status, indicating that the account was removed and interactive sign-in is required
|
|
4294
|
+
* @returns
|
|
4295
|
+
*/
|
|
4296
|
+
InteractionRequiredAuthError.createNativeAccountUnavailableError = function () {
|
|
4297
|
+
return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.native_account_unavailable.code, InteractionRequiredAuthErrorMessage.native_account_unavailable.desc);
|
|
4298
|
+
};
|
|
4287
4299
|
return InteractionRequiredAuthError;
|
|
4288
4300
|
}(AuthError));
|
|
4289
4301
|
|
|
@@ -6518,9 +6530,18 @@ var UsernamePasswordClient = /** @class */ (function (_super) {
|
|
|
6518
6530
|
function isOpenIdConfigResponse(response) {
|
|
6519
6531
|
return (response.hasOwnProperty("authorization_endpoint") &&
|
|
6520
6532
|
response.hasOwnProperty("token_endpoint") &&
|
|
6521
|
-
response.hasOwnProperty("issuer")
|
|
6533
|
+
response.hasOwnProperty("issuer") &&
|
|
6534
|
+
response.hasOwnProperty("jwks_uri"));
|
|
6522
6535
|
}
|
|
6523
6536
|
|
|
6537
|
+
/*
|
|
6538
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6539
|
+
* Licensed under the MIT License.
|
|
6540
|
+
*/
|
|
6541
|
+
var rawMetdataJSON = { "endpointMetadata": { "https://login.microsoftonline.com/common/": { "token_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/common/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.com/common/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net" }, "https://login.chinacloudapi.cn/common/": { "token_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.chinacloudapi.cn/common/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.partner.microsoftonline.cn/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo", "authorization_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.chinacloudapi.cn/common/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.chinacloudapi.cn/common/kerberos", "tenant_region_scope": null, "cloud_instance_name": "partner.microsoftonline.cn", "cloud_graph_host_name": "graph.chinacloudapi.cn", "msgraph_host": "microsoftgraph.chinacloudapi.cn", "rbac_url": "https://pas.chinacloudapi.cn" }, "https://login.microsoftonline.us/common/": { "token_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.us/common/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.us/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.us/common/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.us/common/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.us", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pasff.usgovcloudapi.net" }, "https://login.microsoftonline.com/consumers/": { "token_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/consumers/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.com/consumers/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.com/consumers/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net" }, "https://login.chinacloudapi.cn/consumers/": { "token_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo", "authorization_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.chinacloudapi.cn/consumers/kerberos", "tenant_region_scope": null, "cloud_instance_name": "partner.microsoftonline.cn", "cloud_graph_host_name": "graph.chinacloudapi.cn", "msgraph_host": "microsoftgraph.chinacloudapi.cn", "rbac_url": "https://pas.chinacloudapi.cn" }, "https://login.microsoftonline.us/consumers/": { "token_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.us/consumers/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.us/consumers/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.us/consumers/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.us", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pasff.usgovcloudapi.net" }, "https://login.microsoftonline.com/organizations/": { "token_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/organizations/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.com/organizations/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net" }, "https://login.chinacloudapi.cn/organizations/": { "token_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.partner.microsoftonline.cn/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo", "authorization_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.chinacloudapi.cn/organizations/kerberos", "tenant_region_scope": null, "cloud_instance_name": "partner.microsoftonline.cn", "cloud_graph_host_name": "graph.chinacloudapi.cn", "msgraph_host": "microsoftgraph.chinacloudapi.cn", "rbac_url": "https://pas.chinacloudapi.cn" }, "https://login.microsoftonline.us/organizations/": { "token_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/token", "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.us/organizations/discovery/v2.0/keys", "response_modes_supported": ["query", "fragment", "form_post"], "subject_types_supported": ["pairwise"], "id_token_signing_alg_values_supported": ["RS256"], "response_types_supported": ["code", "id_token", "code id_token", "id_token token"], "scopes_supported": ["openid", "profile", "email", "offline_access"], "issuer": "https://login.microsoftonline.us/{tenantid}/v2.0", "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", "authorization_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize", "device_authorization_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode", "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": "https://login.microsoftonline.us/organizations/oauth2/v2.0/logout", "claims_supported": ["sub", "iss", "cloud_instance_name", "cloud_instance_host_name", "cloud_graph_host_name", "msgraph_host", "aud", "exp", "iat", "auth_time", "acr", "nonce", "preferred_username", "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": "https://login.microsoftonline.us/organizations/kerberos", "tenant_region_scope": null, "cloud_instance_name": "microsoftonline.us", "cloud_graph_host_name": "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pasff.usgovcloudapi.net" } }, "instanceDiscoveryMetadata": { "https://login.microsoftonline.com/common/": { "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.chinacloudapi.cn/common/": { "tenant_discovery_endpoint": "https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.us/common/": { "tenant_discovery_endpoint": "https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.com/consumers/": { "tenant_discovery_endpoint": "https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.chinacloudapi.cn/consumers/": { "tenant_discovery_endpoint": "https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.us/consumers/": { "tenant_discovery_endpoint": "https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.com/organizations/": { "tenant_discovery_endpoint": "https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.chinacloudapi.cn/organizations/": { "tenant_discovery_endpoint": "https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] }, "https://login.microsoftonline.us/organizations/": { "tenant_discovery_endpoint": "https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration", "api-version": "1.1", "metadata": [{ "preferred_network": "login.microsoftonline.com", "preferred_cache": "login.windows.net", "aliases": ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"] }, { "preferred_network": "login.partner.microsoftonline.cn", "preferred_cache": "login.partner.microsoftonline.cn", "aliases": ["login.partner.microsoftonline.cn", "login.chinacloudapi.cn"] }, { "preferred_network": "login.microsoftonline.de", "preferred_cache": "login.microsoftonline.de", "aliases": ["login.microsoftonline.de"] }, { "preferred_network": "login.microsoftonline.us", "preferred_cache": "login.microsoftonline.us", "aliases": ["login.microsoftonline.us", "login.usgovcloudapi.net"] }, { "preferred_network": "login-us.microsoftonline.com", "preferred_cache": "login-us.microsoftonline.com", "aliases": ["login-us.microsoftonline.com"] }] } } };
|
|
6542
|
+
var EndpointMetadata = rawMetdataJSON.endpointMetadata;
|
|
6543
|
+
var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
|
|
6544
|
+
|
|
6524
6545
|
/*
|
|
6525
6546
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6526
6547
|
* Licensed under the MIT License.
|
|
@@ -6564,6 +6585,7 @@ var AuthorityMetadataEntity = /** @class */ (function () {
|
|
|
6564
6585
|
this.end_session_endpoint = metadata.end_session_endpoint;
|
|
6565
6586
|
this.issuer = metadata.issuer;
|
|
6566
6587
|
this.endpointsFromNetwork = fromNetwork;
|
|
6588
|
+
this.jwks_uri = metadata.jwks_uri;
|
|
6567
6589
|
};
|
|
6568
6590
|
/**
|
|
6569
6591
|
* Save the authority that was used to create this cache entry
|
|
@@ -6602,7 +6624,8 @@ var AuthorityMetadataEntity = /** @class */ (function () {
|
|
|
6602
6624
|
entity.hasOwnProperty("issuer") &&
|
|
6603
6625
|
entity.hasOwnProperty("aliasesFromNetwork") &&
|
|
6604
6626
|
entity.hasOwnProperty("endpointsFromNetwork") &&
|
|
6605
|
-
entity.hasOwnProperty("expiresAt")
|
|
6627
|
+
entity.hasOwnProperty("expiresAt") &&
|
|
6628
|
+
entity.hasOwnProperty("jwks_uri"));
|
|
6606
6629
|
};
|
|
6607
6630
|
return AuthorityMetadataEntity;
|
|
6608
6631
|
}());
|
|
@@ -6919,6 +6942,22 @@ var Authority = /** @class */ (function () {
|
|
|
6919
6942
|
enumerable: false,
|
|
6920
6943
|
configurable: true
|
|
6921
6944
|
});
|
|
6945
|
+
Object.defineProperty(Authority.prototype, "jwksUri", {
|
|
6946
|
+
/**
|
|
6947
|
+
* Jwks_uri for token signing keys
|
|
6948
|
+
*/
|
|
6949
|
+
get: function () {
|
|
6950
|
+
if (this.discoveryComplete()) {
|
|
6951
|
+
var endpoint = this.replacePath(this.metadata.jwks_uri);
|
|
6952
|
+
return this.replaceTenant(endpoint);
|
|
6953
|
+
}
|
|
6954
|
+
else {
|
|
6955
|
+
throw ClientAuthError.createEndpointDiscoveryIncompleteError("Discovery incomplete.");
|
|
6956
|
+
}
|
|
6957
|
+
},
|
|
6958
|
+
enumerable: false,
|
|
6959
|
+
configurable: true
|
|
6960
|
+
});
|
|
6922
6961
|
/**
|
|
6923
6962
|
* Replaces tenant in url path with current tenant. Defaults to common.
|
|
6924
6963
|
* @param urlString
|
|
@@ -7002,11 +7041,11 @@ var Authority = /** @class */ (function () {
|
|
|
7002
7041
|
* @param metadataEntity
|
|
7003
7042
|
*/
|
|
7004
7043
|
Authority.prototype.updateEndpointMetadata = function (metadataEntity) {
|
|
7005
|
-
var _a;
|
|
7044
|
+
var _a, _b;
|
|
7006
7045
|
return __awaiter(this, void 0, void 0, function () {
|
|
7007
|
-
var metadata,
|
|
7008
|
-
return __generator(this, function (
|
|
7009
|
-
switch (
|
|
7046
|
+
var metadata, harcodedMetadata;
|
|
7047
|
+
return __generator(this, function (_c) {
|
|
7048
|
+
switch (_c.label) {
|
|
7010
7049
|
case 0:
|
|
7011
7050
|
metadata = this.getEndpointMetadataFromConfig();
|
|
7012
7051
|
if (metadata) {
|
|
@@ -7017,41 +7056,30 @@ var Authority = /** @class */ (function () {
|
|
|
7017
7056
|
// No need to update
|
|
7018
7057
|
return [2 /*return*/, AuthorityMetadataSource.CACHE];
|
|
7019
7058
|
}
|
|
7059
|
+
harcodedMetadata = this.getEndpointMetadataFromHardcodedValues();
|
|
7020
7060
|
return [4 /*yield*/, this.getEndpointMetadataFromNetwork()];
|
|
7021
7061
|
case 1:
|
|
7022
|
-
metadata =
|
|
7062
|
+
metadata = _c.sent();
|
|
7023
7063
|
if (!metadata) return [3 /*break*/, 4];
|
|
7024
7064
|
if (!((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.azureRegion)) return [3 /*break*/, 3];
|
|
7025
|
-
return [4 /*yield*/, this.
|
|
7065
|
+
return [4 /*yield*/, this.updateMetadataWithRegionalInformation(metadata)];
|
|
7026
7066
|
case 2:
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
? autodetectedRegionName
|
|
7030
|
-
: this.authorityOptions.azureRegionConfiguration.azureRegion;
|
|
7031
|
-
if (this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
|
|
7032
|
-
this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?
|
|
7033
|
-
RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :
|
|
7034
|
-
RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
|
|
7035
|
-
}
|
|
7036
|
-
else {
|
|
7037
|
-
if (autodetectedRegionName) {
|
|
7038
|
-
this.regionDiscoveryMetadata.region_outcome = (this.authorityOptions.azureRegionConfiguration.azureRegion === autodetectedRegionName) ?
|
|
7039
|
-
RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :
|
|
7040
|
-
RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;
|
|
7041
|
-
}
|
|
7042
|
-
else {
|
|
7043
|
-
this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
|
|
7044
|
-
}
|
|
7045
|
-
}
|
|
7046
|
-
if (azureRegion) {
|
|
7047
|
-
this.regionDiscoveryMetadata.region_used = azureRegion;
|
|
7048
|
-
metadata = Authority.replaceWithRegionalInformation(metadata, azureRegion);
|
|
7049
|
-
}
|
|
7050
|
-
_b.label = 3;
|
|
7067
|
+
metadata = _c.sent();
|
|
7068
|
+
_c.label = 3;
|
|
7051
7069
|
case 3:
|
|
7052
7070
|
metadataEntity.updateEndpointMetadata(metadata, true);
|
|
7053
7071
|
return [2 /*return*/, AuthorityMetadataSource.NETWORK];
|
|
7054
|
-
case 4:
|
|
7072
|
+
case 4:
|
|
7073
|
+
if (!(harcodedMetadata && !this.authorityOptions.skipAuthorityMetadataCache)) return [3 /*break*/, 7];
|
|
7074
|
+
if (!((_b = this.authorityOptions.azureRegionConfiguration) === null || _b === void 0 ? void 0 : _b.azureRegion)) return [3 /*break*/, 6];
|
|
7075
|
+
return [4 /*yield*/, this.updateMetadataWithRegionalInformation(harcodedMetadata)];
|
|
7076
|
+
case 5:
|
|
7077
|
+
harcodedMetadata = _c.sent();
|
|
7078
|
+
_c.label = 6;
|
|
7079
|
+
case 6:
|
|
7080
|
+
metadataEntity.updateEndpointMetadata(harcodedMetadata, false);
|
|
7081
|
+
return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];
|
|
7082
|
+
case 7: throw ClientAuthError.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint);
|
|
7055
7083
|
}
|
|
7056
7084
|
});
|
|
7057
7085
|
});
|
|
@@ -7082,6 +7110,8 @@ var Authority = /** @class */ (function () {
|
|
|
7082
7110
|
};
|
|
7083
7111
|
/**
|
|
7084
7112
|
* Gets OAuth endpoints from the given OpenID configuration endpoint.
|
|
7113
|
+
*
|
|
7114
|
+
* @param hasHardcodedMetadata boolean
|
|
7085
7115
|
*/
|
|
7086
7116
|
Authority.prototype.getEndpointMetadataFromNetwork = function () {
|
|
7087
7117
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -7108,6 +7138,54 @@ var Authority = /** @class */ (function () {
|
|
|
7108
7138
|
});
|
|
7109
7139
|
});
|
|
7110
7140
|
};
|
|
7141
|
+
/**
|
|
7142
|
+
* Get OAuth endpoints for common authorities.
|
|
7143
|
+
*/
|
|
7144
|
+
Authority.prototype.getEndpointMetadataFromHardcodedValues = function () {
|
|
7145
|
+
if (this.canonicalAuthority in EndpointMetadata) {
|
|
7146
|
+
return EndpointMetadata[this.canonicalAuthority];
|
|
7147
|
+
}
|
|
7148
|
+
return null;
|
|
7149
|
+
};
|
|
7150
|
+
/**
|
|
7151
|
+
* Update the retrieved metadata with regional information.
|
|
7152
|
+
*/
|
|
7153
|
+
Authority.prototype.updateMetadataWithRegionalInformation = function (metadata) {
|
|
7154
|
+
var _a, _b, _c, _d, _e;
|
|
7155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7156
|
+
var autodetectedRegionName, azureRegion;
|
|
7157
|
+
return __generator(this, function (_f) {
|
|
7158
|
+
switch (_f.label) {
|
|
7159
|
+
case 0: return [4 /*yield*/, this.regionDiscovery.detectRegion((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.environmentRegion, this.regionDiscoveryMetadata, this.proxyUrl)];
|
|
7160
|
+
case 1:
|
|
7161
|
+
autodetectedRegionName = _f.sent();
|
|
7162
|
+
azureRegion = ((_b = this.authorityOptions.azureRegionConfiguration) === null || _b === void 0 ? void 0 : _b.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
|
|
7163
|
+
? autodetectedRegionName
|
|
7164
|
+
: (_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.azureRegion;
|
|
7165
|
+
if (((_d = this.authorityOptions.azureRegionConfiguration) === null || _d === void 0 ? void 0 : _d.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
|
|
7166
|
+
this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?
|
|
7167
|
+
RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :
|
|
7168
|
+
RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
|
|
7169
|
+
}
|
|
7170
|
+
else {
|
|
7171
|
+
if (autodetectedRegionName) {
|
|
7172
|
+
this.regionDiscoveryMetadata.region_outcome = (((_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion) === autodetectedRegionName) ?
|
|
7173
|
+
RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :
|
|
7174
|
+
RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;
|
|
7175
|
+
}
|
|
7176
|
+
else {
|
|
7177
|
+
this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
|
|
7178
|
+
}
|
|
7179
|
+
}
|
|
7180
|
+
if (azureRegion) {
|
|
7181
|
+
this.regionDiscoveryMetadata.region_used = azureRegion;
|
|
7182
|
+
return [2 /*return*/, Authority.replaceWithRegionalInformation(metadata, azureRegion)];
|
|
7183
|
+
}
|
|
7184
|
+
return [2 /*return*/, metadata];
|
|
7185
|
+
}
|
|
7186
|
+
});
|
|
7187
|
+
});
|
|
7188
|
+
};
|
|
7111
7189
|
/**
|
|
7112
7190
|
* Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache and returns where the information was retrived from
|
|
7113
7191
|
* @param cachedMetadata
|
|
@@ -7115,7 +7193,7 @@ var Authority = /** @class */ (function () {
|
|
|
7115
7193
|
*/
|
|
7116
7194
|
Authority.prototype.updateCloudDiscoveryMetadata = function (metadataEntity) {
|
|
7117
7195
|
return __awaiter(this, void 0, void 0, function () {
|
|
7118
|
-
var metadata;
|
|
7196
|
+
var metadata, harcodedMetadata;
|
|
7119
7197
|
return __generator(this, function (_a) {
|
|
7120
7198
|
switch (_a.label) {
|
|
7121
7199
|
case 0:
|
|
@@ -7129,6 +7207,7 @@ var Authority = /** @class */ (function () {
|
|
|
7129
7207
|
// No need to update
|
|
7130
7208
|
return [2 /*return*/, AuthorityMetadataSource.CACHE];
|
|
7131
7209
|
}
|
|
7210
|
+
harcodedMetadata = this.getCloudDiscoveryMetadataFromHarcodedValues();
|
|
7132
7211
|
return [4 /*yield*/, this.getCloudDiscoveryMetadataFromNetwork()];
|
|
7133
7212
|
case 1:
|
|
7134
7213
|
metadata = _a.sent();
|
|
@@ -7136,6 +7215,10 @@ var Authority = /** @class */ (function () {
|
|
|
7136
7215
|
metadataEntity.updateCloudDiscoveryMetadata(metadata, true);
|
|
7137
7216
|
return [2 /*return*/, AuthorityMetadataSource.NETWORK];
|
|
7138
7217
|
}
|
|
7218
|
+
if (harcodedMetadata && !this.options.skipAuthorityMetadataCache) {
|
|
7219
|
+
metadataEntity.updateCloudDiscoveryMetadata(harcodedMetadata, false);
|
|
7220
|
+
return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];
|
|
7221
|
+
}
|
|
7139
7222
|
else {
|
|
7140
7223
|
// Metadata could not be obtained from config, cache or network
|
|
7141
7224
|
throw ClientConfigurationError.createUntrustedAuthorityError();
|
|
@@ -7169,7 +7252,8 @@ var Authority = /** @class */ (function () {
|
|
|
7169
7252
|
};
|
|
7170
7253
|
/**
|
|
7171
7254
|
* Called to get metadata from network if CloudDiscoveryMetadata was not populated by config
|
|
7172
|
-
*
|
|
7255
|
+
*
|
|
7256
|
+
* @param hasHardcodedMetadata boolean
|
|
7173
7257
|
*/
|
|
7174
7258
|
Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
|
|
7175
7259
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -7189,7 +7273,9 @@ var Authority = /** @class */ (function () {
|
|
|
7189
7273
|
return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
|
|
7190
7274
|
case 2:
|
|
7191
7275
|
response = _a.sent();
|
|
7192
|
-
metadata = isCloudInstanceDiscoveryResponse(response.body)
|
|
7276
|
+
metadata = isCloudInstanceDiscoveryResponse(response.body)
|
|
7277
|
+
? response.body.metadata
|
|
7278
|
+
: [];
|
|
7193
7279
|
if (metadata.length === 0) {
|
|
7194
7280
|
// If no metadata is returned, authority is untrusted
|
|
7195
7281
|
return [2 /*return*/, null];
|
|
@@ -7209,6 +7295,15 @@ var Authority = /** @class */ (function () {
|
|
|
7209
7295
|
});
|
|
7210
7296
|
});
|
|
7211
7297
|
};
|
|
7298
|
+
/**
|
|
7299
|
+
* Get cloud discovery metadata for common authorities
|
|
7300
|
+
*/
|
|
7301
|
+
Authority.prototype.getCloudDiscoveryMetadataFromHarcodedValues = function () {
|
|
7302
|
+
if (this.canonicalAuthority in InstanceDiscoveryMetadata) {
|
|
7303
|
+
return InstanceDiscoveryMetadata[this.canonicalAuthority];
|
|
7304
|
+
}
|
|
7305
|
+
return null;
|
|
7306
|
+
};
|
|
7212
7307
|
/**
|
|
7213
7308
|
* Helper function to determine if this host is included in the knownAuthorities config option
|
|
7214
7309
|
*/
|