{"version":3,"file":"index.cjs.js","sources":["../src/utils/Constants.ts","../src/error/AuthError.ts","../src/crypto/ICrypto.ts","../src/error/ClientAuthError.ts","../src/utils/StringUtils.ts","../src/logger/Logger.ts","../src/packageMetadata.ts","../src/authority/AuthorityOptions.ts","../src/cache/entities/CredentialEntity.ts","../src/error/ClientConfigurationError.ts","../src/request/ScopeSet.ts","../src/account/ClientInfo.ts","../src/authority/AuthorityType.ts","../src/cache/entities/AccountEntity.ts","../src/account/AuthToken.ts","../src/cache/CacheManager.ts","../src/config/ClientConfiguration.ts","../src/error/ServerError.ts","../src/network/ThrottlingUtils.ts","../src/network/NetworkManager.ts","../src/account/CcsCredential.ts","../src/client/BaseClient.ts","../src/request/RequestValidator.ts","../src/request/RequestParameterBuilder.ts","../src/cache/entities/IdTokenEntity.ts","../src/utils/TimeUtils.ts","../src/cache/entities/AccessTokenEntity.ts","../src/cache/entities/RefreshTokenEntity.ts","../src/error/InteractionRequiredAuthError.ts","../src/cache/entities/CacheRecord.ts","../src/utils/ProtocolUtils.ts","../src/url/UrlString.ts","../src/crypto/PopTokenGenerator.ts","../src/cache/entities/AppMetadataEntity.ts","../src/cache/persistence/TokenCacheContext.ts","../src/response/ResponseHandler.ts","../src/client/AuthorizationCodeClient.ts","../src/client/DeviceCodeClient.ts","../src/telemetry/performance/PerformanceEvent.ts","../src/client/RefreshTokenClient.ts","../src/client/ClientCredentialClient.ts","../src/client/OnBehalfOfClient.ts","../src/client/SilentFlowClient.ts","../src/client/UsernamePasswordClient.ts","../src/authority/OpenIdConfigResponse.ts","../src/authority/AuthorityMetadata.ts","../src/authority/ProtocolMode.ts","../src/cache/entities/AuthorityMetadataEntity.ts","../src/authority/CloudInstanceDiscoveryResponse.ts","../src/authority/RegionDiscovery.ts","../src/authority/Authority.ts","../src/authority/AuthorityFactory.ts","../src/cache/entities/ServerTelemetryEntity.ts","../src/cache/entities/ThrottlingEntity.ts","../src/network/INetworkModule.ts","../src/error/JoseHeaderError.ts","../src/crypto/JoseHeader.ts","../src/request/AuthenticationHeaderParser.ts","../src/telemetry/server/ServerTelemetryManager.ts","../src/telemetry/performance/PerformanceClient.ts","../src/telemetry/performance/StubPerformanceClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport const Constants = {\n LIBRARY_NAME: \"MSAL.JS\",\n SKU: \"msal.js.common\",\n // Prefix for all library cache entries\n CACHE_PREFIX: \"msal\",\n // default authority\n DEFAULT_AUTHORITY: \"https://login.microsoftonline.com/common/\",\n DEFAULT_AUTHORITY_HOST: \"login.microsoftonline.com\",\n DEFAULT_COMMON_TENANT: \"common\",\n // ADFS String\n ADFS: \"adfs\",\n DSTS: \"dstsv2\",\n // Default AAD Instance Discovery Endpoint\n AAD_INSTANCE_DISCOVERY_ENDPT: \"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=\",\n // Resource delimiter - used for certain cache entries\n RESOURCE_DELIM: \"|\",\n // Placeholder for non-existent account ids/objects\n NO_ACCOUNT: \"NO_ACCOUNT\",\n // Claims\n CLAIMS: \"claims\",\n // Consumer UTID\n CONSUMER_UTID: \"9188040d-6c67-4c5b-b112-36a304b66dad\",\n // Default scopes\n OPENID_SCOPE: \"openid\",\n PROFILE_SCOPE: \"profile\",\n OFFLINE_ACCESS_SCOPE: \"offline_access\",\n EMAIL_SCOPE: \"email\",\n // Default response type for authorization code flow\n CODE_RESPONSE_TYPE: \"code\",\n CODE_GRANT_TYPE: \"authorization_code\",\n RT_GRANT_TYPE: \"refresh_token\",\n FRAGMENT_RESPONSE_MODE: \"fragment\",\n S256_CODE_CHALLENGE_METHOD: \"S256\",\n URL_FORM_CONTENT_TYPE: \"application/x-www-form-urlencoded;charset=utf-8\",\n AUTHORIZATION_PENDING: \"authorization_pending\",\n NOT_DEFINED: \"not_defined\",\n EMPTY_STRING: \"\",\n FORWARD_SLASH: \"/\",\n IMDS_ENDPOINT: \"http://169.254.169.254/metadata/instance/compute/location\",\n IMDS_VERSION: \"2020-06-01\",\n IMDS_TIMEOUT: 2000,\n AZURE_REGION_AUTO_DISCOVER_FLAG: \"TryAutoDetect\",\n REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX: \"login.microsoft.com\",\n REGIONAL_AUTH_NON_MSI_QUERY_STRING: \"allowestsrnonmsi=true\",\n KNOWN_PUBLIC_CLOUDS: [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"],\n TOKEN_RESPONSE_TYPE: \"token\",\n ID_TOKEN_RESPONSE_TYPE: \"id_token\",\n SHR_NONCE_VALIDITY: 240\n};\n\nexport const OIDC_DEFAULT_SCOPES = [\n Constants.OPENID_SCOPE,\n Constants.PROFILE_SCOPE,\n Constants.OFFLINE_ACCESS_SCOPE\n];\n\nexport const OIDC_SCOPES = [\n ...OIDC_DEFAULT_SCOPES,\n Constants.EMAIL_SCOPE\n];\n\n/**\n * Request header names\n */\nexport enum HeaderNames {\n CONTENT_TYPE = \"Content-Type\",\n RETRY_AFTER = \"Retry-After\",\n CCS_HEADER = \"X-AnchorMailbox\",\n WWWAuthenticate = \"WWW-Authenticate\",\n AuthenticationInfo = \"Authentication-Info\",\n X_MS_REQUEST_ID = \"x-ms-request-id\"\n}\n\n/**\n * Persistent cache keys MSAL which stay while user is logged in.\n */\nexport enum PersistentCacheKeys {\n ID_TOKEN = \"idtoken\",\n CLIENT_INFO = \"client.info\",\n ADAL_ID_TOKEN = \"adal.idtoken\",\n ERROR = \"error\",\n ERROR_DESC = \"error.description\",\n ACTIVE_ACCOUNT = \"active-account\", // Legacy active-account cache key, use new key instead\n ACTIVE_ACCOUNT_FILTERS = \"active-account-filters\" // new cache entry for active_account for a more robust version for browser\n}\n\n/**\n * String constants related to AAD Authority\n */\nexport enum AADAuthorityConstants {\n COMMON = \"common\",\n ORGANIZATIONS = \"organizations\",\n CONSUMERS = \"consumers\"\n}\n\n/**\n * Keys in the hashParams sent by AAD Server\n */\nexport enum AADServerParamKeys {\n CLIENT_ID = \"client_id\",\n REDIRECT_URI = \"redirect_uri\",\n RESPONSE_TYPE = \"response_type\",\n RESPONSE_MODE = \"response_mode\",\n GRANT_TYPE = \"grant_type\",\n CLAIMS = \"claims\",\n SCOPE = \"scope\",\n ERROR = \"error\",\n ERROR_DESCRIPTION = \"error_description\",\n ACCESS_TOKEN = \"access_token\",\n ID_TOKEN = \"id_token\",\n REFRESH_TOKEN = \"refresh_token\",\n EXPIRES_IN = \"expires_in\",\n STATE = \"state\",\n NONCE = \"nonce\",\n PROMPT = \"prompt\",\n SESSION_STATE = \"session_state\",\n CLIENT_INFO = \"client_info\",\n CODE = \"code\",\n CODE_CHALLENGE = \"code_challenge\",\n CODE_CHALLENGE_METHOD = \"code_challenge_method\",\n CODE_VERIFIER = \"code_verifier\",\n CLIENT_REQUEST_ID = \"client-request-id\",\n X_CLIENT_SKU = \"x-client-SKU\",\n X_CLIENT_VER = \"x-client-VER\",\n X_CLIENT_OS = \"x-client-OS\",\n X_CLIENT_CPU = \"x-client-CPU\",\n X_CLIENT_CURR_TELEM = \"x-client-current-telemetry\",\n X_CLIENT_LAST_TELEM = \"x-client-last-telemetry\",\n X_MS_LIB_CAPABILITY = \"x-ms-lib-capability\",\n X_APP_NAME = \"x-app-name\",\n X_APP_VER = \"x-app-ver\",\n POST_LOGOUT_URI = \"post_logout_redirect_uri\",\n ID_TOKEN_HINT = \"id_token_hint\",\n DEVICE_CODE = \"device_code\",\n CLIENT_SECRET = \"client_secret\",\n CLIENT_ASSERTION = \"client_assertion\",\n CLIENT_ASSERTION_TYPE = \"client_assertion_type\",\n TOKEN_TYPE = \"token_type\",\n REQ_CNF = \"req_cnf\",\n OBO_ASSERTION = \"assertion\",\n REQUESTED_TOKEN_USE = \"requested_token_use\",\n ON_BEHALF_OF = \"on_behalf_of\",\n FOCI = \"foci\",\n CCS_HEADER = \"X-AnchorMailbox\",\n RETURN_SPA_CODE = \"return_spa_code\",\n NATIVE_BROKER = \"nativebroker\",\n LOGOUT_HINT = \"logout_hint\"\n}\n\n/**\n * Claims request keys\n */\nexport enum ClaimsRequestKeys {\n ACCESS_TOKEN = \"access_token\",\n XMS_CC = \"xms_cc\"\n}\n\n/**\n * we considered making this \"enum\" in the request instead of string, however it looks like the allowed list of\n * prompt values kept changing over past couple of years. There are some undocumented prompt values for some\n * internal partners too, hence the choice of generic \"string\" type instead of the \"enum\"\n */\nexport const PromptValue = {\n LOGIN: \"login\",\n SELECT_ACCOUNT: \"select_account\",\n CONSENT: \"consent\",\n NONE: \"none\",\n CREATE: \"create\",\n NO_SESSION: \"no_session\"\n};\n\n/**\n * SSO Types - generated to populate hints\n */\nexport enum SSOTypes {\n ACCOUNT = \"account\",\n SID = \"sid\",\n LOGIN_HINT = \"login_hint\",\n ID_TOKEN = \"id_token\",\n DOMAIN_HINT = \"domain_hint\",\n ORGANIZATIONS = \"organizations\",\n CONSUMERS = \"consumers\",\n ACCOUNT_ID = \"accountIdentifier\",\n HOMEACCOUNT_ID = \"homeAccountIdentifier\"\n}\n\n/**\n * Disallowed extra query parameters.\n */\nexport const BlacklistedEQParams = [\n SSOTypes.SID,\n SSOTypes.LOGIN_HINT\n];\n\n/**\n * allowed values for codeVerifier\n */\nexport const CodeChallengeMethodValues = {\n PLAIN: \"plain\",\n S256: \"S256\"\n};\n\n/**\n * The method used to encode the code verifier for the code challenge parameter. can be one\n * of plain or s256. if excluded, code challenge is assumed to be plaintext. for more\n * information, see the pkce rcf: https://tools.ietf.org/html/rfc7636\n */\nexport const CodeChallengeMethodValuesArray: string[] = [\n CodeChallengeMethodValues.PLAIN,\n CodeChallengeMethodValues.S256\n];\n\n/**\n * allowed values for response_mode\n */\nexport enum ResponseMode {\n QUERY = \"query\",\n FRAGMENT = \"fragment\",\n FORM_POST = \"form_post\"\n}\n\n/**\n * allowed grant_type\n */\nexport enum GrantType {\n IMPLICIT_GRANT = \"implicit\",\n AUTHORIZATION_CODE_GRANT = \"authorization_code\",\n CLIENT_CREDENTIALS_GRANT = \"client_credentials\",\n RESOURCE_OWNER_PASSWORD_GRANT = \"password\",\n REFRESH_TOKEN_GRANT = \"refresh_token\",\n DEVICE_CODE_GRANT = \"device_code\",\n JWT_BEARER = \"urn:ietf:params:oauth:grant-type:jwt-bearer\"\n}\n\n/**\n * Account types in Cache\n */\nexport enum CacheAccountType {\n MSSTS_ACCOUNT_TYPE = \"MSSTS\",\n ADFS_ACCOUNT_TYPE = \"ADFS\",\n MSAV1_ACCOUNT_TYPE = \"MSA\",\n GENERIC_ACCOUNT_TYPE = \"Generic\" // NTLM, Kerberos, FBA, Basic etc\n}\n\n/**\n * Separators used in cache\n */\nexport enum Separators {\n CACHE_KEY_SEPARATOR = \"-\",\n CLIENT_INFO_SEPARATOR = \".\"\n}\n\n/**\n * Credential Type stored in the cache\n */\nexport enum CredentialType {\n ID_TOKEN = \"IdToken\",\n ACCESS_TOKEN = \"AccessToken\",\n ACCESS_TOKEN_WITH_AUTH_SCHEME = \"AccessToken_With_AuthScheme\",\n REFRESH_TOKEN = \"RefreshToken\",\n}\n\n/**\n * Credential Type stored in the cache\n */\nexport enum CacheSchemaType {\n ACCOUNT = \"Account\",\n CREDENTIAL = \"Credential\",\n ID_TOKEN = \"IdToken\",\n ACCESS_TOKEN = \"AccessToken\",\n REFRESH_TOKEN = \"RefreshToken\",\n APP_METADATA = \"AppMetadata\",\n TEMPORARY = \"TempCache\",\n TELEMETRY = \"Telemetry\",\n UNDEFINED = \"Undefined\",\n THROTTLING = \"Throttling\"\n}\n\n/**\n * Combine all cache types\n */\nexport enum CacheType {\n ADFS = 1001,\n MSA = 1002,\n MSSTS = 1003,\n GENERIC = 1004,\n ACCESS_TOKEN = 2001,\n REFRESH_TOKEN = 2002,\n ID_TOKEN = 2003,\n APP_METADATA = 3001,\n UNDEFINED = 9999\n}\n\n/**\n * More Cache related constants\n */\nexport const APP_METADATA = \"appmetadata\";\nexport const CLIENT_INFO = \"client_info\";\nexport const THE_FAMILY_ID = \"1\";\n\nexport const AUTHORITY_METADATA_CONSTANTS = {\n CACHE_KEY: \"authority-metadata\",\n REFRESH_TIME_SECONDS: 3600 * 24 // 24 Hours\n};\n\nexport enum AuthorityMetadataSource {\n CONFIG = \"config\",\n CACHE = \"cache\",\n NETWORK = \"network\",\n HARDCODED_VALUES= \"hardcoded_values\",\n}\n\nexport const SERVER_TELEM_CONSTANTS = {\n SCHEMA_VERSION: 5,\n MAX_CUR_HEADER_BYTES: 80, // ESTS limit is 100B, set to 80 to provide a 20B buffer\n MAX_LAST_HEADER_BYTES: 330, // ESTS limit is 350B, set to 330 to provide a 20B buffer,\n MAX_CACHED_ERRORS: 50, // Limit the number of errors that can be stored to prevent uncontrolled size gains\n CACHE_KEY: \"server-telemetry\",\n CATEGORY_SEPARATOR: \"|\",\n VALUE_SEPARATOR: \",\",\n OVERFLOW_TRUE: \"1\",\n OVERFLOW_FALSE: \"0\",\n UNKNOWN_ERROR: \"unknown_error\"\n};\n\n/**\n * Type of the authentication request\n */\nexport enum AuthenticationScheme {\n BEARER = \"Bearer\",\n POP = \"pop\",\n SSH = \"ssh-cert\"\n}\n\n/**\n * Constants related to throttling\n */\nexport const ThrottlingConstants = {\n // Default time to throttle RequestThumbprint in seconds\n DEFAULT_THROTTLE_TIME_SECONDS: 60,\n // Default maximum time to throttle in seconds, overrides what the server sends back\n DEFAULT_MAX_THROTTLE_TIME_SECONDS: 3600,\n // Prefix for storing throttling entries\n THROTTLING_PREFIX: \"throttling\",\n // Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling\n X_MS_LIB_CAPABILITY_VALUE: \"retry-after, h429\"\n};\n\nexport const Errors = {\n INVALID_GRANT_ERROR: \"invalid_grant\",\n CLIENT_MISMATCH_ERROR: \"client_mismatch\",\n};\n\n/**\n * Password grant parameters\n */\nexport enum PasswordGrantConstants {\n username = \"username\",\n password = \"password\"\n}\n\n/**\n * Response codes\n */\nexport enum ResponseCodes {\n httpSuccess = 200,\n httpBadRequest = 400\n}\n\n/**\n * Region Discovery Sources\n */\nexport enum RegionDiscoverySources {\n FAILED_AUTO_DETECTION = \"1\",\n INTERNAL_CACHE = \"2\",\n ENVIRONMENT_VARIABLE = \"3\",\n IMDS = \"4\",\n}\n\n/**\n * Region Discovery Outcomes\n */\nexport enum RegionDiscoveryOutcomes {\n CONFIGURED_MATCHES_DETECTED = \"1\",\n CONFIGURED_NO_AUTO_DETECTION = \"2\",\n CONFIGURED_NOT_DETECTED = \"3\",\n AUTO_DETECTION_REQUESTED_SUCCESSFUL = \"4\",\n AUTO_DETECTION_REQUESTED_FAILED = \"5\"\n}\n\nexport enum CacheOutcome {\n NO_CACHE_HIT = \"0\",\n FORCE_REFRESH = \"1\",\n NO_CACHED_ACCESS_TOKEN = \"2\",\n CACHED_ACCESS_TOKEN_EXPIRED = \"3\",\n REFRESH_CACHED_ACCESS_TOKEN = \"4\"\n}\n\nexport enum JsonTypes {\n Jwt = \"JWT\",\n Jwk = \"JWK\"\n}\n\nexport const ONE_DAY_IN_MS = 86400000;\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"../utils/Constants\";\n\n/**\n * AuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const AuthErrorMessage = {\n unexpectedError: {\n code: \"unexpected_error\",\n desc: \"Unexpected error in authentication.\"\n },\n postRequestFailed: {\n code: \"post_request_failed\",\n desc: \"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details.\"\n }\n};\n\n/**\n * General error class thrown by the MSAL.js library.\n */\nexport class AuthError extends Error {\n\n /**\n * Short string denoting error\n */\n errorCode: string;\n\n /**\n * Detailed description of error\n */\n errorMessage: string;\n\n /**\n * Describes the subclass of an error\n */\n subError: string;\n\n /**\n * CorrelationId associated with the error\n */\n correlationId: string;\n\n constructor(errorCode?: string, errorMessage?: string, suberror?: string) {\n const errorString = errorMessage ? `${errorCode}: ${errorMessage}` : errorCode;\n super(errorString);\n Object.setPrototypeOf(this, AuthError.prototype);\n\n this.errorCode = errorCode || Constants.EMPTY_STRING;\n this.errorMessage = errorMessage || Constants.EMPTY_STRING;\n this.subError = suberror || Constants.EMPTY_STRING;\n this.name = \"AuthError\";\n }\n\n setCorrelationId(correlationId: string): void {\n this.correlationId = correlationId;\n }\n\n /**\n * Creates an error that is thrown when something unexpected happens in the library.\n * @param errDesc\n */\n static createUnexpectedError(errDesc: string): AuthError {\n return new AuthError(AuthErrorMessage.unexpectedError.code, `${AuthErrorMessage.unexpectedError.desc}: ${errDesc}`);\n }\n\n /**\n * Creates an error for post request failures.\n * @param errDesc \n * @returns \n */\n static createPostRequestFailed(errDesc: string): AuthError {\n return new AuthError(AuthErrorMessage.postRequestFailed.code, `${AuthErrorMessage.postRequestFailed.desc}: ${errDesc}`);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"../error/AuthError\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\nimport { SignedHttpRequest } from \"./SignedHttpRequest\";\n\n/**\n * The PkceCodes type describes the structure\n * of objects that contain PKCE code\n * challenge and verifier pairs\n */\nexport type PkceCodes = {\n verifier: string,\n challenge: string\n};\n\nexport type SignedHttpRequestParameters = Pick & {\n correlationId?: string\n};\n\n/**\n * Interface for crypto functions used by library\n */\nexport interface ICrypto {\n /**\n * Creates a guid randomly.\n */\n createNewGuid(): string;\n /**\n * base64 Encode string\n * @param input \n */\n base64Encode(input: string): string;\n /**\n * base64 decode string\n * @param input \n */\n base64Decode(input: string): string;\n /**\n * Generate PKCE codes for OAuth. See RFC here: https://tools.ietf.org/html/rfc7636\n */\n generatePkceCodes(): Promise;\n /**\n * Generates an JWK RSA S256 Thumbprint\n * @param request\n */\n getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise;\n /**\n * Removes cryptographic keypair from key store matching the keyId passed in\n * @param kid \n */\n removeTokenBindingKey(kid: string): Promise;\n /**\n * Removes all cryptographic keys from IndexedDB storage\n */\n clearKeystore(): Promise;\n /** \n * Returns a signed proof-of-possession token with a given acces token that contains a cnf claim with the required kid.\n * @param accessToken \n */\n signJwt(payload: SignedHttpRequest, kid: string, correlationId?: string): Promise;\n /**\n * Returns the SHA-256 hash of an input string\n * @param plainText\n */\n hashString(plainText: string): Promise;\n}\n\nexport const DEFAULT_CRYPTO_IMPLEMENTATION: ICrypto = {\n createNewGuid: (): string => {\n const notImplErr = \"Crypto interface - createNewGuid() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n base64Decode: (): string => {\n const notImplErr = \"Crypto interface - base64Decode() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n base64Encode: (): string => {\n const notImplErr = \"Crypto interface - base64Encode() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async generatePkceCodes(): Promise {\n const notImplErr = \"Crypto interface - generatePkceCodes() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async getPublicKeyThumbprint(): Promise {\n const notImplErr = \"Crypto interface - getPublicKeyThumbprint() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async removeTokenBindingKey(): Promise {\n const notImplErr = \"Crypto interface - removeTokenBindingKey() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async clearKeystore(): Promise {\n const notImplErr = \"Crypto interface - clearKeystore() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async signJwt(): Promise {\n const notImplErr = \"Crypto interface - signJwt() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async hashString(): Promise {\n const notImplErr = \"Crypto interface - hashString() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n};\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * ClientAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const ClientAuthErrorMessage = {\n clientInfoDecodingError: {\n code: \"client_info_decoding_error\",\n desc: \"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause.\"\n },\n clientInfoEmptyError: {\n code: \"client_info_empty_error\",\n desc: \"The client info was empty. Please review the trace to determine the root cause.\"\n },\n tokenParsingError: {\n code: \"token_parsing_error\",\n desc: \"Token cannot be parsed. Please review stack trace to determine root cause.\"\n },\n nullOrEmptyToken: {\n code: \"null_or_empty_token\",\n desc: \"The token is null or empty. Please review the trace to determine the root cause.\"\n },\n endpointResolutionError: {\n code: \"endpoints_resolution_error\",\n desc: \"Error: could not resolve endpoints. Please check network and try again.\"\n },\n networkError: {\n code: \"network_error\",\n desc: \"Network request failed. Please check network trace to determine root cause.\"\n },\n unableToGetOpenidConfigError: {\n code: \"openid_config_error\",\n desc: \"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.\"\n },\n hashNotDeserialized: {\n code: \"hash_not_deserialized\",\n desc: \"The hash parameters could not be deserialized. Please review the trace to determine the root cause.\"\n },\n blankGuidGenerated: {\n code: \"blank_guid_generated\",\n desc: \"The guid generated was blank. Please review the trace to determine the root cause.\"\n },\n invalidStateError: {\n code: \"invalid_state\",\n desc: \"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState().\"\n },\n stateMismatchError: {\n code: \"state_mismatch\",\n desc: \"State mismatch error. Please check your network. Continued requests may cause cache overflow.\"\n },\n stateNotFoundError: {\n code: \"state_not_found\",\n desc: \"State not found\"\n },\n nonceMismatchError: {\n code: \"nonce_mismatch\",\n desc: \"Nonce mismatch error. This may be caused by a race condition in concurrent requests.\"\n },\n nonceNotFoundError: {\n code: \"nonce_not_found\",\n desc: \"nonce not found\"\n },\n authTimeNotFoundError: {\n code: \"auth_time_not_found\",\n desc: \"Max Age was requested and the ID token is missing the auth_time variable.\" +\n \" auth_time is an optional claim and is not enabled by default - it must be enabled.\" +\n \" See https://aka.ms/msaljs/optional-claims for more information.\"\n },\n maxAgeTranspiredError: {\n code: \"max_age_transpired\",\n desc: \"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.\"\n },\n noTokensFoundError: {\n code: \"no_tokens_found\",\n desc: \"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken().\"\n },\n multipleMatchingTokens: {\n code: \"multiple_matching_tokens\",\n desc: \"The cache contains multiple tokens satisfying the requirements. \" +\n \"Call AcquireToken again providing more requirements such as authority or account.\"\n },\n multipleMatchingAccounts: {\n code: \"multiple_matching_accounts\",\n desc: \"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account\"\n },\n multipleMatchingAppMetadata: {\n code: \"multiple_matching_appMetadata\",\n desc: \"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata\"\n },\n tokenRequestCannotBeMade: {\n code: \"request_cannot_be_made\",\n desc: \"Token request cannot be made without authorization code or refresh token.\"\n },\n appendEmptyScopeError: {\n code: \"cannot_append_empty_scope\",\n desc: \"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info.\"\n },\n removeEmptyScopeError: {\n code: \"cannot_remove_empty_scope\",\n desc: \"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info.\"\n },\n appendScopeSetError: {\n code: \"cannot_append_scopeset\",\n desc: \"Cannot append ScopeSet due to error.\"\n },\n emptyInputScopeSetError: {\n code: \"empty_input_scopeset\",\n desc: \"Empty input ScopeSet cannot be processed.\"\n },\n DeviceCodePollingCancelled: {\n code: \"device_code_polling_cancelled\",\n desc: \"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.\"\n },\n DeviceCodeExpired: {\n code: \"device_code_expired\",\n desc: \"Device code is expired.\"\n },\n DeviceCodeUnknownError: {\n code: \"device_code_unknown_error\",\n desc: \"Device code stopped polling for unknown reasons.\"\n },\n NoAccountInSilentRequest: {\n code: \"no_account_in_silent_request\",\n desc: \"Please pass an account object, silent flow is not supported without account information\"\n },\n invalidCacheRecord: {\n code: \"invalid_cache_record\",\n desc: \"Cache record object was null or undefined.\"\n },\n invalidCacheEnvironment: {\n code: \"invalid_cache_environment\",\n desc: \"Invalid environment when attempting to create cache entry\"\n },\n noAccountFound: {\n code: \"no_account_found\",\n desc: \"No account found in cache for given key.\"\n },\n CachePluginError: {\n code: \"no cache plugin set on CacheManager\",\n desc: \"ICachePlugin needs to be set before using readFromStorage or writeFromStorage\"\n },\n noCryptoObj: {\n code: \"no_crypto_object\",\n desc: \"No crypto object detected. This is required for the following operation: \"\n },\n invalidCacheType: {\n code: \"invalid_cache_type\",\n desc: \"Invalid cache type\"\n },\n unexpectedAccountType: {\n code: \"unexpected_account_type\",\n desc: \"Unexpected account type.\"\n },\n unexpectedCredentialType: {\n code: \"unexpected_credential_type\",\n desc: \"Unexpected credential type.\"\n },\n invalidAssertion: {\n code: \"invalid_assertion\",\n desc: \"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515\"\n },\n invalidClientCredential: {\n code: \"invalid_client_credential\",\n desc: \"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential\"\n },\n tokenRefreshRequired: {\n code: \"token_refresh_required\",\n desc: \"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.\"\n },\n userTimeoutReached: {\n code: \"user_timeout_reached\",\n desc: \"User defined timeout for device code polling reached\",\n },\n tokenClaimsRequired: {\n code: \"token_claims_cnf_required_for_signedjwt\",\n desc: \"Cannot generate a POP jwt if the token_claims are not populated\"\n },\n noAuthorizationCodeFromServer: {\n code: \"authorization_code_missing_from_server_response\",\n desc: \"Server response does not contain an authorization code to proceed\"\n },\n noAzureRegionDetected: {\n code: \"no_azure_region_detected\",\n desc: \"No azure region was detected and no fallback was made available\"\n },\n accessTokenEntityNullError: {\n code: \"access_token_entity_null\",\n desc: \"Access token entity is null, please check logs and cache to ensure a valid access token is present.\"\n },\n bindingKeyNotRemovedError: {\n code: \"binding_key_not_removed\",\n desc: \"Could not remove the credential's binding key from storage.\"\n },\n logoutNotSupported: {\n code: \"end_session_endpoint_not_supported\",\n desc: \"Provided authority does not support logout.\"\n },\n keyIdMissing: {\n code: \"key_id_missing\",\n desc: \"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.\"\n }\n};\n\n/**\n * Error thrown when there is an error in the client code running on the browser.\n */\nexport class ClientAuthError extends AuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n this.name = \"ClientAuthError\";\n\n Object.setPrototypeOf(this, ClientAuthError.prototype);\n }\n\n /**\n * Creates an error thrown when client info object doesn't decode correctly.\n * @param caughtError\n */\n static createClientInfoDecodingError(caughtError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code,\n `${ClientAuthErrorMessage.clientInfoDecodingError.desc} Failed with error: ${caughtError}`);\n }\n\n /**\n * Creates an error thrown if the client info is empty.\n * @param rawClientInfo\n */\n static createClientInfoEmptyError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code,\n `${ClientAuthErrorMessage.clientInfoEmptyError.desc}`);\n }\n\n /**\n * Creates an error thrown when the id token extraction errors out.\n * @param err\n */\n static createTokenParsingError(caughtExtractionError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code,\n `${ClientAuthErrorMessage.tokenParsingError.desc} Failed with error: ${caughtExtractionError}`);\n }\n\n /**\n * Creates an error thrown when the id token string is null or empty.\n * @param invalidRawTokenString\n */\n static createTokenNullOrEmptyError(invalidRawTokenString: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code,\n `${ClientAuthErrorMessage.nullOrEmptyToken.desc} Raw Token Value: ${invalidRawTokenString}`);\n }\n\n /**\n * Creates an error thrown when the endpoint discovery doesn't complete correctly.\n */\n static createEndpointDiscoveryIncompleteError(errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code,\n `${ClientAuthErrorMessage.endpointResolutionError.desc} Detail: ${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the fetch client throws\n */\n static createNetworkError(endpoint: string, errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.networkError.code,\n `${ClientAuthErrorMessage.networkError.desc} | Fetch client threw: ${errDetail} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data\n */\n static createUnableToGetOpenidConfigError(errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code,\n `${ClientAuthErrorMessage.unableToGetOpenidConfigError.desc} Attempted to retrieve endpoints from: ${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the hash cannot be deserialized.\n * @param hashParamObj\n */\n static createHashNotDeserializedError(hashParamObj: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code,\n `${ClientAuthErrorMessage.hashNotDeserialized.desc} Given Object: ${hashParamObj}`);\n }\n\n /**\n * Creates an error thrown when the state cannot be parsed.\n * @param invalidState\n */\n static createInvalidStateError(invalidState: string, errorString?: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code,\n `${ClientAuthErrorMessage.invalidStateError.desc} Invalid State: ${invalidState}, Root Err: ${errorString}`);\n }\n\n /**\n * Creates an error thrown when two states do not match.\n */\n static createStateMismatchError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code,\n ClientAuthErrorMessage.stateMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when the state is not present\n * @param missingState\n */\n static createStateNotFoundError(missingState: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code,\n `${ClientAuthErrorMessage.stateNotFoundError.desc}: ${missingState}`);\n }\n\n /**\n * Creates an error thrown when the nonce does not match.\n */\n static createNonceMismatchError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code,\n ClientAuthErrorMessage.nonceMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when max_age was provided in the request, but auth_time is not in the token claims\n * @param missingNonce\n */\n static createAuthTimeNotFoundError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.authTimeNotFoundError.code,\n ClientAuthErrorMessage.authTimeNotFoundError.desc);\n }\n\n /**\n * Creates an error thrown when too much time has elapsed since the last end-user authentication\n */\n static createMaxAgeTranspiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.maxAgeTranspiredError.code,\n ClientAuthErrorMessage.maxAgeTranspiredError.desc);\n }\n\n /**\n * Creates an error thrown when the mnonce is not present\n * @param missingNonce\n */\n static createNonceNotFoundError(missingNonce: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code,\n `${ClientAuthErrorMessage.nonceNotFoundError.desc}: ${missingNonce}`);\n }\n\n /**\n * Throws error when multiple tokens are in cache.\n */\n static createMultipleMatchingTokensInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code,\n `${ClientAuthErrorMessage.multipleMatchingTokens.desc}.`);\n }\n\n /**\n * Throws error when multiple accounts are in cache for the given params\n */\n static createMultipleMatchingAccountsInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code,\n ClientAuthErrorMessage.multipleMatchingAccounts.desc);\n }\n\n /**\n * Throws error when multiple appMetada are in cache for the given clientId.\n */\n static createMultipleMatchingAppMetadataInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code,\n ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);\n }\n\n /**\n * Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.\n */\n static createTokenRequestCannotBeMadeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);\n }\n\n /**\n * Throws error when attempting to append a null, undefined or empty scope to a set\n * @param givenScope\n */\n static createAppendEmptyScopeToSetError(givenScope: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, `${ClientAuthErrorMessage.appendEmptyScopeError.desc} Given Scope: ${givenScope}`);\n }\n\n /**\n * Throws error when attempting to append a null, undefined or empty scope to a set\n * @param givenScope\n */\n static createRemoveEmptyScopeFromSetError(givenScope: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, `${ClientAuthErrorMessage.removeEmptyScopeError.desc} Given Scope: ${givenScope}`);\n }\n\n /**\n * Throws error when attempting to append null or empty ScopeSet.\n * @param appendError\n */\n static createAppendScopeSetError(appendError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, `${ClientAuthErrorMessage.appendScopeSetError.desc} Detail Error: ${appendError}`);\n }\n\n /**\n * Throws error if ScopeSet is null or undefined.\n * @param givenScopeSet\n */\n static createEmptyInputScopeSetError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, `${ClientAuthErrorMessage.emptyInputScopeSetError.desc}`);\n }\n\n /**\n * Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow\n */\n static createDeviceCodeCancelledError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, `${ClientAuthErrorMessage.DeviceCodePollingCancelled.desc}`);\n }\n\n /**\n * Throws error if device code is expired\n */\n static createDeviceCodeExpiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, `${ClientAuthErrorMessage.DeviceCodeExpired.desc}`);\n }\n\n /**\n * Throws error if device code is expired\n */\n static createDeviceCodeUnknownError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, `${ClientAuthErrorMessage.DeviceCodeUnknownError.desc}`);\n }\n\n /**\n * Throws error when silent requests are made without an account object\n */\n static createNoAccountInSilentRequestError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, `${ClientAuthErrorMessage.NoAccountInSilentRequest.desc}`);\n }\n\n /**\n * Throws error when cache record is null or undefined.\n */\n static createNullOrUndefinedCacheRecord(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);\n }\n\n /**\n * Throws error when provided environment is not part of the CloudDiscoveryMetadata object\n */\n static createInvalidCacheEnvironmentError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);\n }\n\n /**\n * Throws error when account is not found in cache.\n */\n static createNoAccountFoundError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);\n }\n\n /**\n * Throws error if ICachePlugin not set on CacheManager.\n */\n static createCachePluginError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, `${ClientAuthErrorMessage.CachePluginError.desc}`);\n }\n\n /**\n * Throws error if crypto object not found.\n * @param operationName\n */\n static createNoCryptoObjectError(operationName: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, `${ClientAuthErrorMessage.noCryptoObj.desc}${operationName}`);\n }\n\n /**\n * Throws error if cache type is invalid.\n */\n static createInvalidCacheTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code, `${ClientAuthErrorMessage.invalidCacheType.desc}`);\n }\n\n /**\n * Throws error if unexpected account type.\n */\n static createUnexpectedAccountTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, `${ClientAuthErrorMessage.unexpectedAccountType.desc}`);\n }\n\n /**\n * Throws error if unexpected credential type.\n */\n static createUnexpectedCredentialTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, `${ClientAuthErrorMessage.unexpectedCredentialType.desc}`);\n }\n\n /**\n * Throws error if client assertion is not valid.\n */\n static createInvalidAssertionError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, `${ClientAuthErrorMessage.invalidAssertion.desc}`);\n }\n\n /**\n * Throws error if client assertion is not valid.\n */\n static createInvalidCredentialError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code, `${ClientAuthErrorMessage.invalidClientCredential.desc}`);\n }\n\n /**\n * Throws error if token cannot be retrieved from cache due to refresh being required.\n */\n static createRefreshRequiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);\n }\n\n /**\n * Throws error if the user defined timeout is reached.\n */\n static createUserTimeoutReachedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);\n }\n\n /*\n * Throws error if token claims are not populated for a signed jwt generation\n */\n static createTokenClaimsRequiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);\n }\n\n /**\n * Throws error when the authorization code is missing from the server response\n */\n static createNoAuthCodeInServerResponseError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);\n }\n\n static createBindingKeyNotRemovedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);\n }\n\n /**\n * Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint\n */\n static createLogoutNotSupportedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);\n }\n\n /**\n * Create an error when kid attribute is missing from a PoP token's cache record\n */\n static createKeyIdMissingError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DecodedAuthToken } from \"../account/DecodedAuthToken\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\n\n/**\n * @hidden\n */\nexport class StringUtils {\n\n /**\n * decode a JWT\n *\n * @param authToken\n */\n static decodeAuthToken(authToken: string): DecodedAuthToken {\n if (StringUtils.isEmpty(authToken)) {\n throw ClientAuthError.createTokenNullOrEmptyError(authToken);\n }\n const tokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\n const matches = tokenPartsRegex.exec(authToken);\n if (!matches || matches.length < 4) {\n throw ClientAuthError.createTokenParsingError(`Given token is malformed: ${JSON.stringify(authToken)}`);\n }\n const crackedToken: DecodedAuthToken = {\n header: matches[1],\n JWSPayload: matches[2],\n JWSSig: matches[3]\n };\n return crackedToken;\n }\n\n /**\n * Check if a string is empty.\n *\n * @param str\n */\n static isEmpty(str?: string): boolean {\n return (typeof str === \"undefined\" || !str || 0 === str.length);\n }\n\n /**\n * Check if stringified object is empty\n * @param strObj \n */\n static isEmptyObj(strObj?: string): boolean {\n if (strObj && !StringUtils.isEmpty(strObj)) {\n try {\n const obj = JSON.parse(strObj);\n return Object.keys(obj).length === 0;\n } catch (e) {}\n }\n return true;\n }\n\n static startsWith(str: string, search: string): boolean {\n return str.indexOf(search) === 0;\n }\n\n static endsWith(str: string, search: string): boolean {\n return (str.length >= search.length) && (str.lastIndexOf(search) === (str.length - search.length));\n }\n\n /**\n * Parses string into an object.\n *\n * @param query\n */\n static queryStringToObject(query: string): T {\n const obj: {} = {};\n const params = query.split(\"&\");\n const decode = (s: string) => decodeURIComponent(s.replace(/\\+/g, \" \"));\n params.forEach((pair) => {\n if (pair.trim()) {\n const [key, value] = pair.split(/=(.+)/g, 2); // Split on the first occurence of the '=' character\n if (key && value) {\n obj[decode(key)] = decode(value);\n }\n }\n });\n return obj as T;\n }\n\n /**\n * Trims entries in an array.\n *\n * @param arr\n */\n static trimArrayEntries(arr: Array): Array {\n return arr.map(entry => entry.trim());\n }\n\n /**\n * Removes empty strings from array\n * @param arr\n */\n static removeEmptyStringsFromArray(arr: Array): Array {\n return arr.filter(entry => {\n return !StringUtils.isEmpty(entry);\n });\n }\n\n /**\n * Attempts to parse a string into JSON\n * @param str\n */\n static jsonParseHelper(str: string): T | null {\n try {\n return JSON.parse(str) as T;\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Tests if a given string matches a given pattern, with support for wildcards and queries.\n * @param pattern Wildcard pattern to string match. Supports \"*\" for wildcards and \"?\" for queries\n * @param input String to match against\n */\n static matchPattern(pattern: string, input: string): boolean {\n /**\n * Wildcard support: https://stackoverflow.com/a/3117248/4888559\n * Queries: replaces \"?\" in string with escaped \"\\?\" for regex test\n */\n const regex: RegExp = new RegExp(pattern.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\*/g, \"[^ ]*\").replace(/\\?/g, \"\\\\\\?\")); // eslint-disable-line security/detect-non-literal-regexp\n\n return regex.test(input);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { LoggerOptions } from \"../config/ClientConfiguration\";\nimport { Constants } from \"../utils/Constants\";\n\n/**\n * Options for logger messages.\n */\nexport type LoggerMessageOptions = {\n logLevel: LogLevel,\n containsPii?: boolean,\n context?: string,\n correlationId?: string\n};\n\n/**\n * Log message level.\n */\nexport enum LogLevel {\n Error,\n Warning,\n Info,\n Verbose,\n Trace\n}\n\n/**\n * Callback to send the messages to.\n */\nexport interface ILoggerCallback {\n (level: LogLevel, message: string, containsPii: boolean): void;\n}\n\n/**\n * Class which facilitates logging of messages to a specific place.\n */\nexport class Logger {\n\n // Correlation ID for request, usually set by user.\n private correlationId: string;\n\n // Current log level, defaults to info.\n private level: LogLevel = LogLevel.Info;\n\n // Boolean describing whether PII logging is allowed.\n private piiLoggingEnabled: boolean;\n\n // Callback to send messages to.\n private localCallback: ILoggerCallback;\n\n // Package name implementing this logger\n private packageName: string;\n\n // Package version implementing this logger\n private packageVersion: string;\n\n constructor(loggerOptions: LoggerOptions, packageName?: string, packageVersion?: string) {\n const defaultLoggerCallback = () => {\n return;\n };\n this.localCallback = loggerOptions.loggerCallback || defaultLoggerCallback;\n this.piiLoggingEnabled = loggerOptions.piiLoggingEnabled || false;\n this.level = typeof(loggerOptions.logLevel) === \"number\" ? loggerOptions.logLevel : LogLevel.Info;\n this.correlationId = loggerOptions.correlationId || Constants.EMPTY_STRING;\n\n this.packageName = packageName || Constants.EMPTY_STRING;\n this.packageVersion = packageVersion || Constants.EMPTY_STRING;\n }\n\n /**\n * Create new Logger with existing configurations.\n */\n public clone(packageName: string, packageVersion: string, correlationId?: string): Logger {\n return new Logger({loggerCallback: this.localCallback, piiLoggingEnabled: this.piiLoggingEnabled, logLevel: this.level, correlationId: correlationId || this.correlationId}, packageName, packageVersion);\n }\n\n /**\n * Log message with required options.\n */\n private logMessage(logMessage: string, options: LoggerMessageOptions): void {\n if ((options.logLevel > this.level) || (!this.piiLoggingEnabled && options.containsPii)) {\n return;\n }\n const timestamp = new Date().toUTCString();\n\n // Add correlationId to logs if set, correlationId provided on log messages take precedence\n let logHeader: string;\n if (!StringUtils.isEmpty(options.correlationId)) {\n logHeader = `[${timestamp}] : [${options.correlationId}]`;\n } else if (!StringUtils.isEmpty(this.correlationId)) {\n logHeader = `[${timestamp}] : [${this.correlationId}]`;\n } else {\n logHeader = `[${timestamp}]`;\n }\n\n const log = `${logHeader} : ${this.packageName}@${this.packageVersion} : ${LogLevel[options.logLevel]} - ${logMessage}`;\n // debug(`msal:${LogLevel[options.logLevel]}${options.containsPii ? \"-Pii\": Constants.EMPTY_STRING}${options.context ? `:${options.context}` : Constants.EMPTY_STRING}`)(logMessage);\n this.executeCallback(options.logLevel, log, options.containsPii || false);\n }\n\n /**\n * Execute callback with message.\n */\n executeCallback(level: LogLevel, message: string, containsPii: boolean): void {\n if (this.localCallback) {\n this.localCallback(level, message, containsPii);\n }\n }\n\n /**\n * Logs error messages.\n */\n error(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Error,\n containsPii: false,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs error messages with PII.\n */\n errorPii(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Error,\n containsPii: true,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs warning messages.\n */\n warning(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Warning,\n containsPii: false,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs warning messages with PII.\n */\n warningPii(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Warning,\n containsPii: true,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs info messages.\n */\n info(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Info,\n containsPii: false,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs info messages with PII.\n */\n infoPii(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Info,\n containsPii: true,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs verbose messages.\n */\n verbose(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Verbose,\n containsPii: false,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs verbose messages with PII.\n */\n verbosePii(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Verbose,\n containsPii: true,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs trace messages.\n */\n trace(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Trace,\n containsPii: false,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Logs trace messages with PII.\n */\n tracePii(message: string, correlationId?: string): void {\n this.logMessage(message, {\n logLevel: LogLevel.Trace,\n containsPii: true,\n correlationId: correlationId || Constants.EMPTY_STRING\n });\n }\n\n /**\n * Returns whether PII Logging is enabled or not.\n */\n isPiiLoggingEnabled(): boolean {\n return this.piiLoggingEnabled || false;\n }\n}\n","/* eslint-disable header/header */\nexport const name = \"@azure/msal-common\";\nexport const version = \"7.6.0\";\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ProtocolMode } from \"./ProtocolMode\";\nimport { AzureRegionConfiguration } from \"./AzureRegionConfiguration\";\n\nexport type AuthorityOptions = {\n protocolMode: ProtocolMode;\n knownAuthorities: Array;\n cloudDiscoveryMetadata: string;\n authorityMetadata: string;\n skipAuthorityMetadataCache?: boolean;\n azureRegionConfiguration?: AzureRegionConfiguration;\n};\n\nexport enum AzureCloudInstance {\n // AzureCloudInstance is not specified.\n None,\n\n // Microsoft Azure public cloud\n AzurePublic = \"https://login.microsoftonline.com\",\n\n // Microsoft PPE\n AzurePpe = \"https://login.windows-ppe.net\",\n\n // Microsoft Chinese national cloud\n AzureChina = \"https://login.chinacloudapi.cn\",\n\n // Microsoft German national cloud (\"Black Forest\")\n AzureGermany = \"https://login.microsoftonline.de\",\n\n // US Government cloud\n AzureUsGovernment = \"https://login.microsoftonline.us\",\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Separators, CredentialType, CacheType, Constants, AuthenticationScheme } from \"../../utils/Constants\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\n *\n * Key:Value Schema:\n *\n * Key: -------\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)\n * requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request\n * userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow\n * }\n */\nexport class CredentialEntity {\n homeAccountId: string;\n environment: string;\n credentialType: CredentialType;\n clientId: string;\n secret: string;\n familyId?: string;\n realm?: string;\n target?: string;\n userAssertionHash?: string;\n tokenType?: AuthenticationScheme;\n keyId?: string;\n requestedClaimsHash?: string;\n\n /**\n * Generate Account Id key component as per the schema: -\n */\n generateAccountId(): string {\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\n }\n\n /**\n * Generate Credential Id key component as per the schema: --\n */\n generateCredentialId(): string {\n return CredentialEntity.generateCredentialIdForCacheKey(\n this.credentialType,\n this.clientId,\n this.realm,\n this.familyId\n );\n }\n\n /**\n * Generate target key component as per schema: \n */\n generateTarget(): string {\n return CredentialEntity.generateTargetForCacheKey(this.target);\n }\n\n /**\n * generates credential key\n */\n generateCredentialKey(): string {\n return CredentialEntity.generateCredentialCacheKey(\n this.homeAccountId,\n this.environment,\n this.credentialType,\n this.clientId,\n this.realm,\n this.target,\n this.familyId,\n this.tokenType,\n this.requestedClaimsHash,\n );\n }\n\n /**\n * returns the type of the cache (in this case credential)\n */\n generateType(): number {\n switch (this.credentialType) {\n case CredentialType.ID_TOKEN:\n return CacheType.ID_TOKEN;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n return CacheType.ACCESS_TOKEN;\n case CredentialType.REFRESH_TOKEN:\n return CacheType.REFRESH_TOKEN;\n default: {\n throw ClientAuthError.createUnexpectedCredentialTypeError();\n }\n }\n }\n\n /**\n * helper function to return `CredentialType`\n * @param key\n */\n static getCredentialType(key: string): string {\n // First keyword search will match all \"AccessToken\" and \"AccessToken_With_AuthScheme\" credentials\n if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {\n // Perform second search to differentiate between \"AccessToken\" and \"AccessToken_With_AuthScheme\" credential types\n if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {\n return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\n }\n return CredentialType.ACCESS_TOKEN;\n } else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.ID_TOKEN;\n } else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.REFRESH_TOKEN;\n }\n\n return Constants.NOT_DEFINED;\n }\n\n /**\n * generates credential key\n * -\\-----\n */\n static generateCredentialCacheKey(\n homeAccountId: string,\n environment: string,\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n target?: string,\n familyId?: string,\n tokenType?: AuthenticationScheme,\n requestedClaimsHash?: string\n ): string {\n const credentialKey = [\n this.generateAccountIdForCacheKey(homeAccountId, environment),\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\n this.generateTargetForCacheKey(target),\n this.generateClaimsHashForCacheKey(requestedClaimsHash),\n this.generateSchemeForCacheKey(tokenType)\n ];\n\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * generates Account Id for keys\n * @param homeAccountId\n * @param environment\n */\n private static generateAccountIdForCacheKey(\n homeAccountId: string,\n environment: string\n ): string {\n const accountId: Array = [homeAccountId, environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generates Credential Id for keys\n * @param credentialType\n * @param realm\n * @param clientId\n * @param familyId\n */\n private static generateCredentialIdForCacheKey(\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n familyId?: string\n ): string {\n const clientOrFamilyId =\n credentialType === CredentialType.REFRESH_TOKEN\n ? familyId || clientId\n : clientId;\n const credentialId: Array = [\n credentialType,\n clientOrFamilyId,\n realm || Constants.EMPTY_STRING,\n ];\n\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate target key component as per schema: \n */\n private static generateTargetForCacheKey(scopes?: string): string {\n return (scopes || Constants.EMPTY_STRING).toLowerCase();\n }\n\n /**\n * Generate requested claims key component as per schema: \n */\n private static generateClaimsHashForCacheKey(requestedClaimsHash?: string): string {\n return(requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();\n }\n\n /**\n * Generate scheme key componenet as per schema: \n */\n private static generateSchemeForCacheKey(tokenType?: string): string {\n /*\n * PoP Tokens and SSH certs include scheme in cache key\n * Cast to lowercase to handle \"bearer\" from ADFS\n */\n return (tokenType && tokenType.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientAuthError } from \"./ClientAuthError\";\n\n/**\n * ClientConfigurationErrorMessage class containing string constants used by error codes and messages.\n */\nexport const ClientConfigurationErrorMessage = {\n redirectUriNotSet: {\n code: \"redirect_uri_empty\",\n desc: \"A redirect URI is required for all calls, and none has been set.\"\n },\n postLogoutUriNotSet: {\n code: \"post_logout_uri_empty\",\n desc: \"A post logout redirect has not been set.\"\n },\n claimsRequestParsingError: {\n code: \"claims_request_parsing_error\",\n desc: \"Could not parse the given claims request object.\"\n },\n authorityUriInsecure: {\n code: \"authority_uri_insecure\",\n desc: \"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options\"\n },\n urlParseError: {\n code: \"url_parse_error\",\n desc: \"URL could not be parsed into appropriate segments.\"\n },\n urlEmptyError: {\n code: \"empty_url_error\",\n desc: \"URL was empty or null.\"\n },\n emptyScopesError: {\n code: \"empty_input_scopes_error\",\n desc: \"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.\"\n },\n nonArrayScopesError: {\n code: \"nonarray_input_scopes_error\",\n desc: \"Scopes cannot be passed as non-array.\"\n },\n clientIdSingleScopeError: {\n code: \"clientid_input_scopes_error\",\n desc: \"Client ID can only be provided as a single scope.\"\n },\n invalidPrompt: {\n code: \"invalid_prompt_value\",\n desc: \"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest\",\n },\n invalidClaimsRequest: {\n code: \"invalid_claims\",\n desc: \"Given claims parameter must be a stringified JSON object.\"\n },\n tokenRequestEmptyError: {\n code: \"token_request_empty\",\n desc: \"Token request was empty and not found in cache.\"\n },\n logoutRequestEmptyError: {\n code: \"logout_request_empty\",\n desc: \"The logout request was null or undefined.\"\n },\n invalidCodeChallengeMethod: {\n code: \"invalid_code_challenge_method\",\n desc: \"code_challenge_method passed is invalid. Valid values are \\\"plain\\\" and \\\"S256\\\".\"\n },\n invalidCodeChallengeParams: {\n code: \"pkce_params_missing\",\n desc: \"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request\"\n },\n invalidCloudDiscoveryMetadata: {\n code: \"invalid_cloud_discovery_metadata\",\n desc: \"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields\"\n },\n invalidAuthorityMetadata: {\n code: \"invalid_authority_metadata\",\n desc: \"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.\"\n },\n untrustedAuthority: {\n code: \"untrusted_authority\",\n desc: \"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.\"\n },\n invalidAzureCloudInstance: {\n code: \"invalid_azure_cloud_instance\",\n desc: \"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values\"\n },\n missingSshJwk: {\n code: \"missing_ssh_jwk\",\n desc: \"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.\"\n },\n missingSshKid: {\n code: \"missing_ssh_kid\",\n desc: \"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.\"\n },\n missingNonceAuthenticationHeader: {\n code: \"missing_nonce_authentication_header\",\n desc: \"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.\"\n },\n invalidAuthenticationHeader: {\n code: \"invalid_authentication_header\",\n desc: \"Invalid authentication header provided\"\n }\n};\n\n/**\n * Error thrown when there is an error in configuration of the MSAL.js library.\n */\nexport class ClientConfigurationError extends ClientAuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n this.name = \"ClientConfigurationError\";\n Object.setPrototypeOf(this, ClientConfigurationError.prototype);\n }\n\n /**\n * Creates an error thrown when the redirect uri is empty (not set by caller)\n */\n static createRedirectUriEmptyError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.redirectUriNotSet.code,\n ClientConfigurationErrorMessage.redirectUriNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)\n */\n static createPostLogoutRedirectUriEmptyError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.postLogoutUriNotSet.code,\n ClientConfigurationErrorMessage.postLogoutUriNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the claims request could not be successfully parsed\n */\n static createClaimsRequestParsingError(claimsRequestParseError: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.claimsRequestParsingError.code,\n `${ClientConfigurationErrorMessage.claimsRequestParsingError.desc} Given value: ${claimsRequestParseError}`);\n }\n\n /**\n * Creates an error thrown if authority uri is given an insecure protocol.\n * @param urlString\n */\n static createInsecureAuthorityUriError(urlString: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityUriInsecure.code,\n `${ClientConfigurationErrorMessage.authorityUriInsecure.desc} Given URI: ${urlString}`);\n }\n\n /**\n * Creates an error thrown if URL string does not parse into separate segments.\n * @param urlString\n */\n static createUrlParseError(urlParseError: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlParseError.code,\n `${ClientConfigurationErrorMessage.urlParseError.desc} Given Error: ${urlParseError}`);\n }\n\n /**\n * Creates an error thrown if URL string is empty or null.\n * @param urlString\n */\n static createUrlEmptyError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlEmptyError.code,\n ClientConfigurationErrorMessage.urlEmptyError.desc);\n }\n\n /**\n * Error thrown when scopes are empty.\n * @param scopesValue\n */\n static createEmptyScopesArrayError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.emptyScopesError.code,\n `${ClientConfigurationErrorMessage.emptyScopesError.desc}`);\n }\n\n /**\n * Error thrown when client id scope is not provided as single scope.\n * @param inputScopes\n */\n static createClientIdSingleScopeError(inputScopes: Array): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.clientIdSingleScopeError.code,\n `${ClientConfigurationErrorMessage.clientIdSingleScopeError.desc} Given Scopes: ${inputScopes}`);\n }\n\n /**\n * Error thrown when prompt is not an allowed type.\n * @param promptValue\n */\n static createInvalidPromptError(promptValue: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidPrompt.code,\n `${ClientConfigurationErrorMessage.invalidPrompt.desc} Given value: ${promptValue}`);\n }\n\n /**\n * Creates error thrown when claims parameter is not a stringified JSON object\n */\n static createInvalidClaimsRequestError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidClaimsRequest.code,\n ClientConfigurationErrorMessage.invalidClaimsRequest.desc);\n }\n\n /**\n * Throws error when token request is empty and nothing cached in storage.\n */\n static createEmptyLogoutRequestError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.logoutRequestEmptyError.code,\n ClientConfigurationErrorMessage.logoutRequestEmptyError.desc\n );\n }\n\n /**\n * Throws error when token request is empty and nothing cached in storage.\n */\n static createEmptyTokenRequestError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.tokenRequestEmptyError.code,\n ClientConfigurationErrorMessage.tokenRequestEmptyError.desc\n );\n }\n\n /**\n * Throws error when an invalid code_challenge_method is passed by the user\n */\n static createInvalidCodeChallengeMethodError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.invalidCodeChallengeMethod.code,\n ClientConfigurationErrorMessage.invalidCodeChallengeMethod.desc\n );\n }\n\n /**\n * Throws error when both params: code_challenge and code_challenge_method are not passed together\n */\n static createInvalidCodeChallengeParamsError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.invalidCodeChallengeParams.code,\n ClientConfigurationErrorMessage.invalidCodeChallengeParams.desc\n );\n }\n\n /**\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\n */\n static createInvalidCloudDiscoveryMetadataError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.code,\n ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.desc);\n }\n\n /**\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\n */\n static createInvalidAuthorityMetadataError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityMetadata.code,\n ClientConfigurationErrorMessage.invalidAuthorityMetadata.desc);\n }\n\n /**\n * Throws error when provided authority is not a member of the trusted host list\n */\n static createUntrustedAuthorityError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code,\n ClientConfigurationErrorMessage.untrustedAuthority.desc);\n }\n\n /**\n * Throws error when the AzureCloudInstance is set to an invalid value\n */\n static createInvalidAzureCloudInstanceError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAzureCloudInstance.code,\n ClientConfigurationErrorMessage.invalidAzureCloudInstance.desc);\n }\n\n /**\n * Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request\n */\n static createMissingSshJwkError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshJwk.code,\n ClientConfigurationErrorMessage.missingSshJwk.desc);\n }\n\n /**\n * Throws an error when the authentication scheme is set to SSH but the SSH public key ID is omitted from the request\n */\n static createMissingSshKidError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshKid.code,\n ClientConfigurationErrorMessage.missingSshKid.desc);\n }\n\n /**\n * Throws error when provided headers don't contain a header that a server nonce can be extracted from\n */\n static createMissingNonceAuthenticationHeadersError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.code,\n ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.desc);\n }\n\n /**\n * Throws error when a provided header is invalid in any way\n */\n static createInvalidAuthenticationHeaderError(invalidHeaderName: string, details: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code,\n `${ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc}. Invalid header: ${invalidHeaderName}. Details: ${details}`);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { Constants, OIDC_SCOPES } from \"../utils/Constants\";\n\n/**\n * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes\n * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions\n * to ensure uniqueness of strings.\n */\nexport class ScopeSet {\n // Scopes as a Set of strings\n private scopes: Set;\n\n constructor(inputScopes: Array) {\n // Filter empty string and null/undefined array items\n const scopeArr = inputScopes ? StringUtils.trimArrayEntries([...inputScopes]) : [];\n const filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];\n\n // Validate and filter scopes (validate function throws if validation fails)\n this.validateInputScopes(filteredInput);\n\n this.scopes = new Set(); // Iterator in constructor not supported by IE11\n filteredInput.forEach(scope => this.scopes.add(scope));\n }\n\n /**\n * Factory method to create ScopeSet from space-delimited string\n * @param inputScopeString\n * @param appClientId\n * @param scopesRequired\n */\n static fromString(inputScopeString: string): ScopeSet {\n const scopeString = inputScopeString || Constants.EMPTY_STRING;\n const inputScopes: Array = scopeString.split(\" \");\n return new ScopeSet(inputScopes);\n }\n\n /**\n * Used to validate the scopes input parameter requested by the developer.\n * @param {Array} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\n * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not\n */\n private validateInputScopes(inputScopes: Array): void {\n // Check if scopes are required but not given or is an empty array\n if (!inputScopes || inputScopes.length < 1) {\n throw ClientConfigurationError.createEmptyScopesArrayError();\n }\n }\n\n /**\n * Check if a given scope is present in this set of scopes.\n * @param scope\n */\n containsScope(scope: string): boolean {\n const lowerCaseScopes = this.printScopesLowerCase().split(\" \");\n const lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);\n // compare lowercase scopes\n return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;\n }\n\n /**\n * Check if a set of scopes is present in this set of scopes.\n * @param scopeSet\n */\n containsScopeSet(scopeSet: ScopeSet): boolean {\n if (!scopeSet || scopeSet.scopes.size <= 0) {\n return false;\n }\n\n return (this.scopes.size >= scopeSet.scopes.size && scopeSet.asArray().every(scope => this.containsScope(scope)));\n }\n\n /**\n * Check if set of scopes contains only the defaults\n */\n containsOnlyOIDCScopes(): boolean {\n let defaultScopeCount = 0;\n OIDC_SCOPES.forEach((defaultScope: string) => {\n if (this.containsScope(defaultScope)) {\n defaultScopeCount += 1;\n }\n });\n\n return this.scopes.size === defaultScopeCount;\n }\n\n /**\n * Appends single scope if passed\n * @param newScope\n */\n appendScope(newScope: string): void {\n if (!StringUtils.isEmpty(newScope)) {\n this.scopes.add(newScope.trim());\n }\n }\n\n /**\n * Appends multiple scopes if passed\n * @param newScopes\n */\n appendScopes(newScopes: Array): void {\n try {\n newScopes.forEach(newScope => this.appendScope(newScope));\n } catch (e) {\n throw ClientAuthError.createAppendScopeSetError(e);\n }\n }\n\n /**\n * Removes element from set of scopes.\n * @param scope\n */\n removeScope(scope: string): void {\n if (StringUtils.isEmpty(scope)) {\n throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);\n }\n this.scopes.delete(scope.trim());\n }\n\n /**\n * Removes default scopes from set of scopes\n * Primarily used to prevent cache misses if the default scopes are not returned from the server\n */\n removeOIDCScopes(): void {\n OIDC_SCOPES.forEach((defaultScope: string) => {\n this.scopes.delete(defaultScope);\n });\n }\n\n /**\n * Combines an array of scopes with the current set of scopes.\n * @param otherScopes\n */\n unionScopeSets(otherScopes: ScopeSet): Set {\n if (!otherScopes) {\n throw ClientAuthError.createEmptyInputScopeSetError();\n }\n const unionScopes = new Set(); // Iterator in constructor not supported in IE11\n otherScopes.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\n this.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\n return unionScopes;\n }\n\n /**\n * Check if scopes intersect between this set and another.\n * @param otherScopes\n */\n intersectingScopeSets(otherScopes: ScopeSet): boolean {\n if (!otherScopes) {\n throw ClientAuthError.createEmptyInputScopeSetError();\n }\n \n // Do not allow OIDC scopes to be the only intersecting scopes\n if (!otherScopes.containsOnlyOIDCScopes()) {\n otherScopes.removeOIDCScopes();\n }\n const unionScopes = this.unionScopeSets(otherScopes);\n const sizeOtherScopes = otherScopes.getScopeCount();\n const sizeThisScopes = this.getScopeCount();\n const sizeUnionScopes = unionScopes.size;\n return sizeUnionScopes < (sizeThisScopes + sizeOtherScopes);\n }\n\n /**\n * Returns size of set of scopes.\n */\n getScopeCount(): number {\n return this.scopes.size;\n }\n\n /**\n * Returns the scopes as an array of string values\n */\n asArray(): Array {\n const array: Array = [];\n this.scopes.forEach(val => array.push(val));\n return array;\n }\n\n /**\n * Prints scopes into a space-delimited string\n */\n printScopes(): string {\n if (this.scopes) {\n const scopeArr = this.asArray();\n return scopeArr.join(\" \");\n }\n return Constants.EMPTY_STRING;\n }\n\n /**\n * Prints scopes into a space-delimited lower-case string (used for caching)\n */\n printScopesLowerCase(): string {\n return this.printScopes().toLowerCase();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { Separators, Constants } from \"../utils/Constants\";\n\n/**\n * Client info object which consists of two IDs. Need to add more info here.\n */\nexport type ClientInfo = {\n uid: string,\n utid: string\n};\n\n/**\n * Function to build a client info object from server clientInfo string\n * @param rawClientInfo\n * @param crypto\n */\nexport function buildClientInfo(rawClientInfo: string, crypto: ICrypto): ClientInfo {\n if (StringUtils.isEmpty(rawClientInfo)) {\n throw ClientAuthError.createClientInfoEmptyError();\n }\n\n try {\n const decodedClientInfo: string = crypto.base64Decode(rawClientInfo);\n return JSON.parse(decodedClientInfo) as ClientInfo;\n } catch (e) {\n throw ClientAuthError.createClientInfoDecodingError((e as ClientAuthError).message);\n }\n}\n\n/**\n * Function to build a client info object from cached homeAccountId string\n * @param homeAccountId \n */\nexport function buildClientInfoFromHomeAccountId(homeAccountId: string): ClientInfo {\n if (StringUtils.isEmpty(homeAccountId)) {\n throw ClientAuthError.createClientInfoDecodingError(\"Home account ID was empty.\");\n }\n const clientInfoParts: string[] = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);\n return {\n uid: clientInfoParts[0],\n utid: clientInfoParts.length < 2 ? Constants.EMPTY_STRING : clientInfoParts[1]\n };\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Authority types supported by MSAL.\n */\nexport enum AuthorityType {\n Default,\n Adfs,\n Dsts\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n Separators,\n CacheAccountType,\n CacheType,\n Constants,\n} from \"../../utils/Constants\";\nimport { Authority } from \"../../authority/Authority\";\nimport { AuthToken } from \"../../account/AuthToken\";\nimport { ICrypto } from \"../../crypto/ICrypto\";\nimport { buildClientInfo } from \"../../account/ClientInfo\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { AccountInfo } from \"../../account/AccountInfo\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\nimport { AuthorityType } from \"../../authority/AuthorityType\";\nimport { Logger } from \"../../logger/Logger\";\nimport { TokenClaims } from \"../../account/TokenClaims\";\n\n/**\n * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).\n *\n * Key : Value Schema\n *\n * Key: --\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * realm: Full tenant or organizational identifier that the account belongs to\n * localAccountId: Original tenant-specific accountID, usually used for legacy cases\n * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt\n * authorityType: Accounts authority type as a string\n * name: Full name for the account, including given name and family name,\n * clientInfo: Full base64 encoded client info received from ESTS\n * lastModificationTime: last time this entity was modified in the cache\n * lastModificationApp:\n * idTokenClaims: Object containing claims parsed from ID token\n * nativeAccountId: Account identifier on the native device\n * }\n */\nexport class AccountEntity {\n homeAccountId: string;\n environment: string;\n realm: string;\n localAccountId: string;\n username: string;\n authorityType: string;\n name?: string;\n clientInfo?: string;\n lastModificationTime?: string;\n lastModificationApp?: string;\n cloudGraphHostName?: string;\n msGraphHost?: string;\n idTokenClaims?: TokenClaims;\n nativeAccountId?: string;\n\n /**\n * Generate Account Id key component as per the schema: -\n */\n generateAccountId(): string {\n const accountId: Array = [this.homeAccountId, this.environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate Account Cache Key as per the schema: --\n */\n generateAccountKey(): string {\n return AccountEntity.generateAccountCacheKey({\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId\n });\n }\n\n /**\n * returns the type of the cache (in this case account)\n */\n generateType(): number {\n switch (this.authorityType) {\n case CacheAccountType.ADFS_ACCOUNT_TYPE:\n return CacheType.ADFS;\n case CacheAccountType.MSAV1_ACCOUNT_TYPE:\n return CacheType.MSA;\n case CacheAccountType.MSSTS_ACCOUNT_TYPE:\n return CacheType.MSSTS;\n case CacheAccountType.GENERIC_ACCOUNT_TYPE:\n return CacheType.GENERIC;\n default: {\n throw ClientAuthError.createUnexpectedAccountTypeError();\n }\n }\n }\n\n /**\n * Returns the AccountInfo interface for this account.\n */\n getAccountInfo(): AccountInfo {\n return {\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId,\n name: this.name,\n idTokenClaims: this.idTokenClaims,\n nativeAccountId: this.nativeAccountId\n };\n }\n\n /**\n * Generates account key from interface\n * @param accountInterface\n */\n static generateAccountCacheKey(accountInterface: AccountInfo): string {\n const accountKey = [\n accountInterface.homeAccountId,\n accountInterface.environment || Constants.EMPTY_STRING,\n accountInterface.tenantId || Constants.EMPTY_STRING,\n ];\n\n return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.\n * @param clientInfo\n * @param authority\n * @param idToken\n * @param policy\n */\n static createAccount(\n clientInfo: string,\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string,\n nativeAccountId?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;\n account.clientInfo = clientInfo;\n account.homeAccountId = homeAccountId;\n account.nativeAccountId = nativeAccountId;\n\n const env = environment || (authority && authority.getPreferredCache());\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n account.environment = env;\n // non AAD scenarios can have empty realm\n account.realm = idToken?.claims?.tid || Constants.EMPTY_STRING;\n\n if (idToken) {\n account.idTokenClaims = idToken.claims;\n\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || Constants.EMPTY_STRING;\n\n /*\n * In B2C scenarios the emails claim is used instead of preferred_username and it is an array.\n * In most cases it will contain a single email. This field should not be relied upon if a custom \n * policy is configured to return more than 1 email.\n */\n const preferredUsername = idToken?.claims?.preferred_username;\n const email = (idToken?.claims?.emails) ? idToken.claims.emails[0] : null;\n \n account.username = preferredUsername || email || Constants.EMPTY_STRING;\n account.name = idToken?.claims?.name;\n }\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n return account;\n }\n\n /**\n * Builds non-AAD/ADFS account.\n * @param authority\n * @param idToken\n */\n static createGenericAccount(\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = (\n authority &&\n authority.authorityType === AuthorityType.Adfs\n ) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;\n \n account.homeAccountId = homeAccountId;\n // non AAD scenarios can have empty realm\n account.realm = Constants.EMPTY_STRING;\n\n const env = environment || authority && authority.getPreferredCache();\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n if (idToken) {\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || Constants.EMPTY_STRING;\n // upn claim for most ADFS scenarios\n account.username = idToken?.claims?.upn || Constants.EMPTY_STRING;\n account.name = idToken?.claims?.name || Constants.EMPTY_STRING;\n account.idTokenClaims = idToken?.claims;\n }\n\n account.environment = env;\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n /*\n * add uniqueName to claims\n * account.name = idToken.claims.uniqueName;\n */\n\n return account;\n }\n\n /**\n * Generate HomeAccountId from server response\n * @param serverClientInfo\n * @param authType\n */\n static generateHomeAccountId(\n serverClientInfo: string,\n authType: AuthorityType,\n logger: Logger,\n cryptoObj: ICrypto,\n idToken?: AuthToken\n ): string {\n\n const accountId = idToken?.claims?.sub ? idToken.claims.sub : Constants.EMPTY_STRING;\n\n // since ADFS does not have tid and does not set client_info\n if (authType === AuthorityType.Adfs || authType === AuthorityType.Dsts) {\n return accountId;\n }\n\n // for cases where there is clientInfo\n if (serverClientInfo) {\n try {\n const clientInfo = buildClientInfo(serverClientInfo, cryptoObj);\n if (!StringUtils.isEmpty(clientInfo.uid) && !StringUtils.isEmpty(clientInfo.utid)) {\n return `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`;\n }\n } catch (e) {}\n }\n\n // default to \"sub\" claim\n logger.verbose(\"No client info in response\");\n return accountId;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAccountEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"localAccountId\") &&\n entity.hasOwnProperty(\"username\") &&\n entity.hasOwnProperty(\"authorityType\")\n );\n }\n\n /**\n * Helper function to determine whether 2 accountInfo objects represent the same account\n * @param accountA\n * @param accountB\n * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality\n */\n static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean {\n if (!accountA || !accountB) {\n return false;\n }\n\n let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false\n if (compareClaims) {\n const accountAClaims = (accountA.idTokenClaims || {}) as TokenClaims;\n const accountBClaims = (accountB.idTokenClaims || {}) as TokenClaims;\n\n // issued at timestamp and nonce are expected to change each time a new id token is acquired\n claimsMatch = (accountAClaims.iat === accountBClaims.iat) &&\n (accountAClaims.nonce === accountBClaims.nonce);\n }\n\n return (accountA.homeAccountId === accountB.homeAccountId) &&\n (accountA.localAccountId === accountB.localAccountId) &&\n (accountA.username === accountB.username) &&\n (accountA.tenantId === accountB.tenantId) &&\n (accountA.environment === accountB.environment) &&\n (accountA.nativeAccountId === accountB.nativeAccountId) &&\n claimsMatch;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TokenClaims } from \"./TokenClaims\";\nimport { DecodedAuthToken } from \"./DecodedAuthToken\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ICrypto } from \"../crypto/ICrypto\";\n\n/**\n * JWT Token representation class. Parses token string and generates claims object.\n */\nexport class AuthToken {\n\n // Raw Token string\n rawToken: string;\n // Claims inside token\n claims: TokenClaims;\n constructor(rawToken: string, crypto: ICrypto) {\n if (StringUtils.isEmpty(rawToken)) {\n throw ClientAuthError.createTokenNullOrEmptyError(rawToken);\n }\n\n this.rawToken = rawToken;\n this.claims = AuthToken.extractTokenClaims(rawToken, crypto);\n }\n\n /**\n * Extract token by decoding the rawToken\n *\n * @param encodedToken\n */\n static extractTokenClaims(encodedToken: string, crypto: ICrypto): TokenClaims {\n\n const decodedToken: DecodedAuthToken = StringUtils.decodeAuthToken(encodedToken);\n\n // token will be decoded to get the username\n try {\n const base64TokenPayload = decodedToken.JWSPayload;\n\n // base64Decode() should throw an error if there is an issue\n const base64Decoded = crypto.base64Decode(base64TokenPayload);\n return JSON.parse(base64Decoded) as TokenClaims;\n } catch (err) {\n throw ClientAuthError.createTokenParsingError(err);\n }\n }\n\n /**\n * Determine if the token's max_age has transpired\n */\n static checkMaxAge(authTime: number, maxAge: number): void {\n /*\n * per https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest\n * To force an immediate re-authentication: If an app requires that a user re-authenticate prior to access,\n * provide a value of 0 for the max_age parameter and the AS will force a fresh login.\n */\n const fiveMinuteSkew = 300000; // five minutes in milliseconds\n if ((maxAge === 0) || ((Date.now() - fiveMinuteSkew) > (authTime + maxAge))) {\n throw ClientAuthError.createMaxAgeTranspiredError();\n }\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AccountCache, AccountFilter, CredentialFilter, CredentialCache, ValidCredentialType, AppMetadataFilter, AppMetadataCache } from \"./utils/CacheTypes\";\nimport { CacheRecord } from \"./entities/CacheRecord\";\nimport { CacheSchemaType, CredentialType, Constants, APP_METADATA, THE_FAMILY_ID, AUTHORITY_METADATA_CONSTANTS, AuthenticationScheme } from \"../utils/Constants\";\nimport { CredentialEntity } from \"./entities/CredentialEntity\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { AccountEntity } from \"./entities/AccountEntity\";\nimport { AccessTokenEntity } from \"./entities/AccessTokenEntity\";\nimport { IdTokenEntity } from \"./entities/IdTokenEntity\";\nimport { RefreshTokenEntity } from \"./entities/RefreshTokenEntity\";\nimport { AuthError } from \"../error/AuthError\";\nimport { ICacheManager } from \"./interface/ICacheManager\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { AccountInfo } from \"../account/AccountInfo\";\nimport { AppMetadataEntity } from \"./entities/AppMetadataEntity\";\nimport { ServerTelemetryEntity } from \"./entities/ServerTelemetryEntity\";\nimport { ThrottlingEntity } from \"./entities/ThrottlingEntity\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { AuthorityMetadataEntity } from \"./entities/AuthorityMetadataEntity\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\n/**\n * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.\n */\nexport abstract class CacheManager implements ICacheManager {\n protected clientId: string;\n protected cryptoImpl: ICrypto;\n\n constructor(clientId: string, cryptoImpl: ICrypto) {\n this.clientId = clientId;\n this.cryptoImpl = cryptoImpl;\n }\n\n /**\n * fetch the account entity from the platform cache\n * @param accountKey\n */\n abstract getAccount(accountKey: string): AccountEntity | null;\n\n /**\n * set account entity in the platform cache\n * @param account\n */\n abstract setAccount(account: AccountEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param idTokenKey\n */\n abstract getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param idToken\n */\n abstract setIdTokenCredential(idToken: IdTokenEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param accessTokenKey\n */\n abstract getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param accessToken\n */\n abstract setAccessTokenCredential(accessToken: AccessTokenEntity): void;\n\n /**\n * fetch the idToken entity from the platform cache\n * @param refreshTokenKey\n */\n abstract getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;\n\n /**\n * set idToken entity to the platform cache\n * @param refreshToken\n */\n abstract setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;\n\n /**\n * fetch appMetadata entity from the platform cache\n * @param appMetadataKey\n */\n abstract getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;\n\n /**\n * set appMetadata entity to the platform cache\n * @param appMetadata\n */\n abstract setAppMetadata(appMetadata: AppMetadataEntity): void;\n\n /**\n * fetch server telemetry entity from the platform cache\n * @param serverTelemetryKey\n */\n abstract getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;\n\n /**\n * set server telemetry entity to the platform cache\n * @param serverTelemetryKey\n * @param serverTelemetry\n */\n abstract setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;\n\n /**\n * fetch cloud discovery metadata entity from the platform cache\n * @param key\n */\n abstract getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;\n\n /**\n *\n */\n abstract getAuthorityMetadataKeys(): Array;\n\n /**\n * set cloud discovery metadata entity to the platform cache\n * @param key\n * @param value\n */\n abstract setAuthorityMetadata(key: string, value: AuthorityMetadataEntity): void;\n\n /**\n * fetch throttling entity from the platform cache\n * @param throttlingCacheKey\n */\n abstract getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;\n\n /**\n * set throttling entity to the platform cache\n * @param throttlingCacheKey\n * @param throttlingCache\n */\n abstract setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;;\n\n /**\n * Function to remove an item from cache given its key.\n * @param key\n */\n abstract removeItem(key: string, type?: string): boolean;\n\n /**\n * Function which returns boolean whether cache contains a specific key.\n * @param key\n */\n abstract containsKey(key: string, type?: string): boolean;\n\n /**\n * Function which retrieves all current keys from the cache.\n */\n abstract getKeys(): string[];\n\n /**\n * Function which clears cache.\n */\n abstract clear(): Promise;\n\n /**\n * Function which updates an outdated credential cache key\n */\n abstract updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;\n\n /**\n * Returns all accounts in cache\n */\n getAllAccounts(): AccountInfo[] {\n const currentAccounts: AccountCache = this.getAccountsFilteredBy();\n const accountValues: AccountEntity[] = Object.keys(currentAccounts).map(accountKey => currentAccounts[accountKey]);\n const numAccounts = accountValues.length;\n if (numAccounts < 1) {\n return [];\n } else {\n const allAccounts = accountValues.map((value) => {\n const accountEntity = CacheManager.toObject(new AccountEntity(), value);\n const accountInfo = accountEntity.getAccountInfo();\n const idToken = this.readIdTokenFromCache(this.clientId, accountInfo);\n if (idToken && !accountInfo.idTokenClaims) {\n accountInfo.idToken = idToken.secret;\n accountInfo.idTokenClaims = new AuthToken(idToken.secret, this.cryptoImpl).claims;\n }\n\n return accountInfo;\n\n });\n return allAccounts;\n }\n }\n\n /**\n * saves a cache record\n * @param cacheRecord\n */\n async saveCacheRecord(cacheRecord: CacheRecord): Promise {\n if (!cacheRecord) {\n throw ClientAuthError.createNullOrUndefinedCacheRecord();\n }\n\n if (!!cacheRecord.account) {\n this.setAccount(cacheRecord.account);\n }\n\n if (!!cacheRecord.idToken) {\n this.setIdTokenCredential(cacheRecord.idToken);\n }\n\n if (!!cacheRecord.accessToken) {\n await this.saveAccessToken(cacheRecord.accessToken);\n }\n\n if (!!cacheRecord.refreshToken) {\n this.setRefreshTokenCredential(cacheRecord.refreshToken);\n }\n\n if (!!cacheRecord.appMetadata) {\n this.setAppMetadata(cacheRecord.appMetadata);\n }\n }\n\n /**\n * saves access token credential\n * @param credential\n */\n private async saveAccessToken(credential: AccessTokenEntity): Promise {\n const currentTokenCache = this.getCredentialsFilteredBy({\n clientId: credential.clientId,\n credentialType: credential.credentialType,\n environment: credential.environment,\n homeAccountId: credential.homeAccountId,\n realm: credential.realm,\n tokenType: credential.tokenType,\n requestedClaimsHash: credential.requestedClaimsHash\n });\n\n const currentScopes = ScopeSet.fromString(credential.target);\n const currentAccessTokens: AccessTokenEntity[] = Object.keys(currentTokenCache.accessTokens).map(key => currentTokenCache.accessTokens[key]);\n\n if (currentAccessTokens) {\n const removedAccessTokens: Array> = [];\n currentAccessTokens.forEach((tokenEntity) => {\n const tokenScopeSet = ScopeSet.fromString(tokenEntity.target);\n if (tokenScopeSet.intersectingScopeSets(currentScopes)) {\n removedAccessTokens.push(this.removeCredential(tokenEntity));\n }\n });\n await Promise.all(removedAccessTokens);\n }\n this.setAccessTokenCredential(credential);\n }\n\n /**\n * retrieve accounts matching all provided filters; if no filter is set, get all accounts\n * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\n * @param homeAccountId\n * @param environment\n * @param realm\n */\n getAccountsFilteredBy(accountFilter?: AccountFilter): AccountCache {\n return this.getAccountsFilteredByInternal(\n accountFilter ? accountFilter.homeAccountId : Constants.EMPTY_STRING,\n accountFilter ? accountFilter.environment : Constants.EMPTY_STRING,\n accountFilter ? accountFilter.realm : Constants.EMPTY_STRING,\n accountFilter ? accountFilter.nativeAccountId: Constants.EMPTY_STRING,\n );\n }\n\n /**\n * retrieve accounts matching all provided filters; if no filter is set, get all accounts\n * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\n * @param homeAccountId\n * @param environment\n * @param realm\n */\n private getAccountsFilteredByInternal(\n homeAccountId?: string,\n environment?: string,\n realm?: string,\n nativeAccountId?: string,\n ): AccountCache {\n const allCacheKeys = this.getKeys();\n const matchingAccounts: AccountCache = {};\n\n allCacheKeys.forEach((cacheKey) => {\n const entity: AccountEntity | null = this.getAccount(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (!!homeAccountId && !this.matchHomeAccountId(entity, homeAccountId)) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!realm && !this.matchRealm(entity, realm)) {\n return;\n }\n\n if (!!nativeAccountId && !this.matchNativeAccountId(entity, nativeAccountId)) {\n return;\n }\n\n matchingAccounts[cacheKey] = entity;\n });\n\n return matchingAccounts;\n }\n\n /**\n * retrieve credentails matching all provided filters; if no filter is set, get all credentials\n * @param homeAccountId\n * @param environment\n * @param credentialType\n * @param clientId\n * @param realm\n * @param target\n */\n getCredentialsFilteredBy(filter: CredentialFilter): CredentialCache {\n return this.getCredentialsFilteredByInternal(\n filter.homeAccountId,\n filter.environment,\n filter.credentialType,\n filter.clientId,\n filter.familyId,\n filter.realm,\n filter.target,\n filter.userAssertionHash,\n filter.tokenType,\n filter.keyId,\n filter.requestedClaimsHash\n );\n }\n\n /**\n * Support function to help match credentials\n * @param homeAccountId\n * @param environment\n * @param credentialType\n * @param clientId\n * @param realm\n * @param target\n * @param userAssertionHash\n * @param tokenType\n */\n private getCredentialsFilteredByInternal(\n homeAccountId?: string,\n environment?: string,\n credentialType?: string,\n clientId?: string,\n familyId?: string,\n realm?: string,\n target?: string,\n userAssertionHash?: string,\n tokenType?: AuthenticationScheme,\n keyId?: string,\n requestedClaimsHash?: string\n ): CredentialCache {\n const allCacheKeys = this.getKeys();\n const matchingCredentials: CredentialCache = {\n idTokens: {},\n accessTokens: {},\n refreshTokens: {},\n };\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-credential type cache entities\n const credType = CredentialEntity.getCredentialType(cacheKey);\n\n if (credType === Constants.NOT_DEFINED) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getSpecificCredential(cacheKey, credType);\n\n if (!entity) {\n return;\n }\n\n if (!!userAssertionHash && !this.matchUserAssertionHash(entity, userAssertionHash)) {\n return;\n }\n\n /*\n * homeAccountId can undefined, and we want to filter out cached items that have a homeAccountId of \"\"\n * because we don't want a client_credential request to return a cached token that has a homeAccountId\n */\n if ((typeof homeAccountId === \"string\") && !this.matchHomeAccountId(entity, homeAccountId)) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!realm && !this.matchRealm(entity, realm)) {\n return;\n }\n\n if (!!credentialType && !this.matchCredentialType(entity, credentialType)) {\n return;\n }\n\n if (!!clientId && !this.matchClientId(entity, clientId)) {\n return;\n }\n\n if (!!familyId && !this.matchFamilyId(entity, familyId)) {\n return;\n }\n\n /*\n * idTokens do not have \"target\", target specific refreshTokens do exist for some types of authentication\n * Resource specific refresh tokens case will be added when the support is deemed necessary\n */\n if (!!target && !this.matchTarget(entity, target)) {\n return;\n }\n\n // If request OR cached entity has requested Claims Hash, check if they match\n if (requestedClaimsHash || entity.requestedClaimsHash) {\n // Don't match if either is undefined or they are different\n if (entity.requestedClaimsHash !== requestedClaimsHash) {\n return;\n }\n }\n\n // Access Token with Auth Scheme specific matching\n if (credentialType === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {\n if(!!tokenType && !this.matchTokenType(entity, tokenType)) {\n return;\n }\n\n // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key\n if (tokenType === AuthenticationScheme.SSH) {\n if(keyId && !this.matchKeyId(entity, keyId)) {\n return;\n }\n }\n }\n\n // At this point, the entity matches the request, update cache key if key schema has changed\n const updatedCacheKey = this.updateCredentialCacheKey(cacheKey, entity);\n\n switch (credType) {\n case CredentialType.ID_TOKEN:\n matchingCredentials.idTokens[updatedCacheKey] = entity as IdTokenEntity;\n break;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n matchingCredentials.accessTokens[updatedCacheKey] = entity as AccessTokenEntity;\n break;\n case CredentialType.REFRESH_TOKEN:\n matchingCredentials.refreshTokens[updatedCacheKey] = entity as RefreshTokenEntity;\n break;\n }\n });\n\n return matchingCredentials;\n }\n\n /**\n * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata\n * @param filter\n */\n getAppMetadataFilteredBy(filter: AppMetadataFilter): AppMetadataCache {\n return this.getAppMetadataFilteredByInternal(\n filter.environment,\n filter.clientId,\n );\n }\n\n /**\n * Support function to help match appMetadata\n * @param environment\n * @param clientId\n */\n private getAppMetadataFilteredByInternal(\n environment?: string,\n clientId?: string\n ): AppMetadataCache {\n\n const allCacheKeys = this.getKeys();\n const matchingAppMetadata: AppMetadataCache = {};\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-appMetadata type cache entities\n if (!this.isAppMetadata(cacheKey)) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getAppMetadata(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (!!environment && !this.matchEnvironment(entity, environment)) {\n return;\n }\n\n if (!!clientId && !this.matchClientId(entity, clientId)) {\n return;\n }\n\n matchingAppMetadata[cacheKey] = entity;\n\n });\n\n return matchingAppMetadata;\n }\n\n /**\n * retrieve authorityMetadata that contains a matching alias\n * @param filter\n */\n getAuthorityMetadataByAlias(host: string): AuthorityMetadataEntity | null {\n const allCacheKeys = this.getAuthorityMetadataKeys();\n let matchedEntity = null;\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-authorityMetadata type cache entities\n if (!this.isAuthorityMetadata(cacheKey) || cacheKey.indexOf(this.clientId) === -1) {\n return;\n }\n\n // Attempt retrieval\n const entity = this.getAuthorityMetadata(cacheKey);\n\n if (!entity) {\n return;\n }\n\n if (entity.aliases.indexOf(host) === -1) {\n return;\n }\n\n matchedEntity = entity;\n\n });\n\n return matchedEntity;\n }\n\n /**\n * Removes all accounts and related tokens from cache.\n */\n async removeAllAccounts(): Promise {\n const allCacheKeys = this.getKeys();\n const removedAccounts: Array> = [];\n\n allCacheKeys.forEach((cacheKey) => {\n const entity = this.getAccount(cacheKey);\n if (!entity) {\n return;\n }\n removedAccounts.push(this.removeAccount(cacheKey));\n });\n\n await Promise.all(removedAccounts);\n return true;\n }\n\n /**\n * returns a boolean if the given account is removed\n * @param account\n */\n async removeAccount(accountKey: string): Promise {\n const account = this.getAccount(accountKey);\n if (!account) {\n throw ClientAuthError.createNoAccountFoundError();\n }\n return (await this.removeAccountContext(account) && this.removeItem(accountKey, CacheSchemaType.ACCOUNT));\n }\n\n /**\n * Removes credentials associated with the provided account\n * @param account\n */\n async removeAccountContext(account: AccountEntity): Promise {\n const allCacheKeys = this.getKeys();\n const accountId = account.generateAccountId();\n const removedCredentials: Array> = [];\n\n allCacheKeys.forEach((cacheKey) => {\n // don't parse any non-credential type cache entities\n const credType = CredentialEntity.getCredentialType(cacheKey);\n if (credType === Constants.NOT_DEFINED) {\n return;\n }\n\n const cacheEntity = this.getSpecificCredential(cacheKey, credType);\n if (!!cacheEntity && accountId === cacheEntity.generateAccountId()) {\n removedCredentials.push(this.removeCredential(cacheEntity));\n }\n });\n\n await Promise.all(removedCredentials);\n return true;\n }\n\n /**\n * returns a boolean if the given credential is removed\n * @param credential\n */\n async removeCredential(credential: CredentialEntity): Promise {\n const key = credential.generateCredentialKey();\n\n // Remove Token Binding Key from key store for PoP Tokens Credentials\n if (credential.credentialType.toLowerCase() === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {\n if(credential.tokenType === AuthenticationScheme.POP) {\n const accessTokenWithAuthSchemeEntity = credential as AccessTokenEntity;\n const kid = accessTokenWithAuthSchemeEntity.keyId;\n\n if (kid) {\n try {\n await this.cryptoImpl.removeTokenBindingKey(kid);\n } catch (error) {\n throw ClientAuthError.createBindingKeyNotRemovedError();\n }\n }\n }\n }\n\n return this.removeItem(key, CacheSchemaType.CREDENTIAL);\n }\n\n /**\n * Removes all app metadata objects from cache.\n */\n removeAppMetadata(): boolean {\n const allCacheKeys = this.getKeys();\n allCacheKeys.forEach((cacheKey) => {\n if (this.isAppMetadata(cacheKey)) {\n this.removeItem(cacheKey, CacheSchemaType.APP_METADATA);\n }\n });\n\n return true;\n }\n\n /**\n * Retrieve the cached credentials into a cacherecord\n * @param account\n * @param clientId\n * @param scopes\n * @param environment\n * @param authScheme\n */\n readCacheRecord(account: AccountInfo, clientId: string, request: BaseAuthRequest, environment: string): CacheRecord {\n\n const cachedAccount = this.readAccountFromCache(account);\n const cachedIdToken = this.readIdTokenFromCache(clientId, account);\n const cachedAccessToken = this.readAccessTokenFromCache(clientId, account, request);\n const cachedRefreshToken = this.readRefreshTokenFromCache(clientId, account, false);\n const cachedAppMetadata = this.readAppMetadataFromCache(environment, clientId);\n\n if (cachedAccount && cachedIdToken) {\n cachedAccount.idTokenClaims = new AuthToken(cachedIdToken.secret, this.cryptoImpl).claims;\n }\n\n return {\n account: cachedAccount,\n idToken: cachedIdToken,\n accessToken: cachedAccessToken,\n refreshToken: cachedRefreshToken,\n appMetadata: cachedAppMetadata,\n };\n }\n\n /**\n * Retrieve AccountEntity from cache\n * @param account\n */\n readAccountFromCache(account: AccountInfo): AccountEntity | null {\n const accountKey: string = AccountEntity.generateAccountCacheKey(account);\n return this.getAccount(accountKey);\n }\n\n /**\n * Retrieve AccountEntity from cache\n * @param nativeAccountId\n * @returns AccountEntity or Null\n */\n readAccountFromCacheWithNativeAccountId(nativeAccountId: string): AccountEntity | null {\n // fetch account from memory\n const accountFilter: AccountFilter = {\n nativeAccountId\n };\n const accountCache: AccountCache = this.getAccountsFilteredBy(accountFilter);\n const accounts = Object.keys(accountCache).map((key) => accountCache[key]);\n\n if (accounts.length < 1) {\n return null;\n } else if (accounts.length > 1) {\n throw ClientAuthError.createMultipleMatchingAccountsInCacheError();\n }\n\n return accountCache[0];\n }\n\n /**\n * Retrieve IdTokenEntity from cache\n * @param clientId\n * @param account\n * @param inputRealm\n */\n readIdTokenFromCache(clientId: string, account: AccountInfo): IdTokenEntity | null {\n const idTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: CredentialType.ID_TOKEN,\n clientId: clientId,\n realm: account.tenantId,\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(idTokenFilter);\n const idTokens = Object.keys(credentialCache.idTokens).map((key) => credentialCache.idTokens[key]);\n const numIdTokens = idTokens.length;\n\n if (numIdTokens < 1) {\n return null;\n } else if (numIdTokens > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n\n return idTokens[0] as IdTokenEntity;\n }\n\n /**\n * Retrieve AccessTokenEntity from cache\n * @param clientId\n * @param account\n * @param scopes\n * @param authScheme\n */\n readAccessTokenFromCache(clientId: string, account: AccountInfo, request: BaseAuthRequest): AccessTokenEntity | null {\n const scopes = new ScopeSet(request.scopes || []);\n const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;\n /*\n * Distinguish between Bearer and PoP/SSH token cache types\n * Cast to lowercase to handle \"bearer\" from ADFS\n */\n const credentialType = (authScheme && authScheme.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN;\n\n const accessTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: credentialType,\n clientId,\n realm: account.tenantId,\n target: scopes.printScopesLowerCase(),\n tokenType: authScheme,\n keyId: request.sshKid,\n requestedClaimsHash: request.requestedClaimsHash,\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(accessTokenFilter);\n\n const accessTokens = Object.keys(credentialCache.accessTokens).map((key) => credentialCache.accessTokens[key]);\n\n const numAccessTokens = accessTokens.length;\n if (numAccessTokens < 1) {\n return null;\n } else if (numAccessTokens > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n\n return accessTokens[0] as AccessTokenEntity;\n }\n\n /**\n * Helper to retrieve the appropriate refresh token from cache\n * @param clientId\n * @param account\n * @param familyRT\n */\n readRefreshTokenFromCache(clientId: string, account: AccountInfo, familyRT: boolean): RefreshTokenEntity | null {\n const id = familyRT ? THE_FAMILY_ID : undefined;\n const refreshTokenFilter: CredentialFilter = {\n homeAccountId: account.homeAccountId,\n environment: account.environment,\n credentialType: CredentialType.REFRESH_TOKEN,\n clientId: clientId,\n familyId: id,\n };\n\n const credentialCache: CredentialCache = this.getCredentialsFilteredBy(refreshTokenFilter);\n const refreshTokens = Object.keys(credentialCache.refreshTokens).map((key) => credentialCache.refreshTokens[key]);\n\n const numRefreshTokens = refreshTokens.length;\n if (numRefreshTokens < 1) {\n return null;\n }\n // address the else case after remove functions address environment aliases\n\n return refreshTokens[0] as RefreshTokenEntity;\n }\n\n /**\n * Retrieve AppMetadataEntity from cache\n */\n readAppMetadataFromCache(environment: string, clientId: string): AppMetadataEntity | null {\n const appMetadataFilter: AppMetadataFilter = {\n environment,\n clientId,\n };\n\n const appMetadata: AppMetadataCache = this.getAppMetadataFilteredBy(appMetadataFilter);\n const appMetadataEntries: AppMetadataEntity[] = Object.keys(appMetadata).map((key) => appMetadata[key]);\n\n const numAppMetadata = appMetadataEntries.length;\n if (numAppMetadata < 1) {\n return null;\n } else if (numAppMetadata > 1) {\n throw ClientAuthError.createMultipleMatchingAppMetadataInCacheError();\n }\n\n return appMetadataEntries[0] as AppMetadataEntity;\n }\n\n /**\n * Return the family_id value associated with FOCI\n * @param environment\n * @param clientId\n */\n isAppMetadataFOCI(environment: string, clientId: string): boolean {\n const appMetadata = this.readAppMetadataFromCache(environment, clientId);\n return !!(appMetadata && appMetadata.familyId === THE_FAMILY_ID);\n }\n\n /**\n * helper to match account ids\n * @param value\n * @param homeAccountId\n */\n private matchHomeAccountId(entity: AccountEntity | CredentialEntity, homeAccountId: string): boolean {\n return !!((typeof entity.homeAccountId === \"string\") && (homeAccountId === entity.homeAccountId));\n }\n\n /**\n * helper to match assertion\n * @param value\n * @param oboAssertion\n */\n private matchUserAssertionHash(entity: CredentialEntity, userAssertionHash: string): boolean {\n return !!(entity.userAssertionHash && userAssertionHash === entity.userAssertionHash);\n }\n\n /**\n * helper to match environment\n * @param value\n * @param environment\n */\n private matchEnvironment(entity: AccountEntity | CredentialEntity | AppMetadataEntity, environment: string): boolean {\n const cloudMetadata = this.getAuthorityMetadataByAlias(environment);\n if (cloudMetadata && cloudMetadata.aliases.indexOf(entity.environment) > -1) {\n return true;\n }\n\n return false;\n }\n\n /**\n * helper to match credential type\n * @param entity\n * @param credentialType\n */\n private matchCredentialType(entity: CredentialEntity, credentialType: string): boolean {\n return (entity.credentialType && credentialType.toLowerCase() === entity.credentialType.toLowerCase());\n }\n\n /**\n * helper to match client ids\n * @param entity\n * @param clientId\n */\n private matchClientId(entity: CredentialEntity | AppMetadataEntity, clientId: string): boolean {\n return !!(entity.clientId && clientId === entity.clientId);\n }\n\n /**\n * helper to match family ids\n * @param entity\n * @param familyId\n */\n private matchFamilyId(entity: CredentialEntity | AppMetadataEntity, familyId: string): boolean {\n return !!(entity.familyId && familyId === entity.familyId);\n }\n\n /**\n * helper to match realm\n * @param entity\n * @param realm\n */\n private matchRealm(entity: AccountEntity | CredentialEntity, realm: string): boolean {\n return !!(entity.realm && realm === entity.realm);\n }\n\n /**\n * helper to match nativeAccountId\n * @param entity\n * @param nativeAccountId\n * @returns boolean indicating the match result\n */\n private matchNativeAccountId(entity: AccountEntity, nativeAccountId: string): boolean {\n return !!(entity.nativeAccountId && nativeAccountId === entity.nativeAccountId);\n }\n\n /**\n * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.\n * @param entity\n * @param target\n */\n private matchTarget(entity: CredentialEntity, target: string): boolean {\n const isNotAccessTokenCredential = (entity.credentialType !== CredentialType.ACCESS_TOKEN && entity.credentialType !== CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME);\n\n if ( isNotAccessTokenCredential || !entity.target) {\n return false;\n }\n\n const entityScopeSet: ScopeSet = ScopeSet.fromString(entity.target);\n const requestTargetScopeSet: ScopeSet = ScopeSet.fromString(target);\n\n if (!requestTargetScopeSet.containsOnlyOIDCScopes()) {\n requestTargetScopeSet.removeOIDCScopes(); // ignore OIDC scopes\n } else {\n requestTargetScopeSet.removeScope(Constants.OFFLINE_ACCESS_SCOPE);\n }\n return entityScopeSet.containsScopeSet(requestTargetScopeSet);\n }\n\n /**\n * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise\n * @param entity\n * @param tokenType\n */\n private matchTokenType(entity: CredentialEntity, tokenType: AuthenticationScheme): boolean {\n return !!(entity.tokenType && entity.tokenType === tokenType);\n }\n\n /**\n * Returns true if the credential's keyId matches the one in the request, false otherwise\n * @param entity\n * @param tokenType\n */\n private matchKeyId(entity: CredentialEntity, keyId: string): boolean {\n return !!(entity.keyId && entity.keyId === keyId);\n }\n\n /**\n * returns if a given cache entity is of the type appmetadata\n * @param key\n */\n private isAppMetadata(key: string): boolean {\n return key.indexOf(APP_METADATA) !== -1;\n }\n\n /**\n * returns if a given cache entity is of the type authoritymetadata\n * @param key\n */\n protected isAuthorityMetadata(key: string): boolean {\n return key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) !== -1;\n }\n\n /**\n * returns cache key used for cloud instance metadata\n */\n generateAuthorityMetadataCacheKey(authority: string): string {\n return `${AUTHORITY_METADATA_CONSTANTS.CACHE_KEY}-${this.clientId}-${authority}`;\n }\n\n /**\n * Returns the specific credential (IdToken/AccessToken/RefreshToken) from the cache\n * @param key\n * @param credType\n */\n private getSpecificCredential(key: string, credType: string): ValidCredentialType | null {\n switch (credType) {\n case CredentialType.ID_TOKEN: {\n return this.getIdTokenCredential(key);\n }\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME: {\n return this.getAccessTokenCredential(key);\n }\n case CredentialType.REFRESH_TOKEN: {\n return this.getRefreshTokenCredential(key);\n }\n default:\n return null;\n }\n }\n\n /**\n * Helper to convert serialized data to object\n * @param obj\n * @param json\n */\n static toObject(obj: T, json: object): T {\n for (const propertyName in json) {\n obj[propertyName] = json[propertyName];\n }\n return obj;\n }\n}\n\nexport class DefaultStorageClass extends CacheManager {\n setAccount(): void {\n const notImplErr = \"Storage interface - setAccount() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAccount(): AccountEntity {\n const notImplErr = \"Storage interface - getAccount() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setIdTokenCredential(): void {\n const notImplErr = \"Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getIdTokenCredential(): IdTokenEntity {\n const notImplErr = \"Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAccessTokenCredential(): void {\n const notImplErr = \"Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAccessTokenCredential(): AccessTokenEntity {\n const notImplErr = \"Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setRefreshTokenCredential(): void {\n const notImplErr = \"Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getRefreshTokenCredential(): RefreshTokenEntity {\n const notImplErr = \"Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAppMetadata(): void {\n const notImplErr = \"Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAppMetadata(): AppMetadataEntity {\n const notImplErr = \"Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setServerTelemetry(): void {\n const notImplErr = \"Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getServerTelemetry(): ServerTelemetryEntity {\n const notImplErr = \"Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setAuthorityMetadata(): void {\n const notImplErr = \"Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAuthorityMetadata(): AuthorityMetadataEntity | null {\n const notImplErr = \"Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getAuthorityMetadataKeys(): Array {\n const notImplErr = \"Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n setThrottlingCache(): void {\n const notImplErr = \"Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getThrottlingCache(): ThrottlingEntity {\n const notImplErr = \"Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n removeItem(): boolean {\n const notImplErr = \"Storage interface - removeItem() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n containsKey(): boolean {\n const notImplErr = \"Storage interface - containsKey() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n getKeys(): string[] {\n const notImplErr = \"Storage interface - getKeys() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n async clear(): Promise {\n const notImplErr = \"Storage interface - clear() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n updateCredentialCacheKey(): string {\n const notImplErr = \"Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n}\n","/*\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,\n systemOptions: Required,\n loggerOptions : Required,\n storageInterface: CacheManager,\n networkInterface : INetworkModule,\n cryptoInterface : Required,\n libraryInfo : LibraryInfo,\n telemetry: Required,\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;\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 = {\n tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,\n preventCorsPreflight: false,\n proxyUrl: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_LOGGER_IMPLEMENTATION: Required = {\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(): Promise {\n const notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async sendPostRequestAsync(): Promise {\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 = {\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 {\n return {\n clientCapabilities: [],\n azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,\n skipAuthorityMetadataCache: false,\n ...authOptions\n };\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * Error thrown when there is an error with the server code, for example, unavailability.\n */\nexport class ServerError extends AuthError {\n\n constructor(errorCode?: string, errorMessage?: string, subError?: string) {\n super(errorCode, errorMessage, subError);\n this.name = \"ServerError\";\n\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { NetworkResponse } from \"./NetworkManager\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { HeaderNames, CacheSchemaType, ThrottlingConstants, Constants } from \"../utils/Constants\";\nimport { CacheManager } from \"../cache/CacheManager\";\nimport { ServerError } from \"../error/ServerError\";\nimport { RequestThumbprint } from \"./RequestThumbprint\";\nimport { ThrottlingEntity } from \"../cache/entities/ThrottlingEntity\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\nexport class ThrottlingUtils {\n\n /**\n * Prepares a RequestThumbprint to be stored as a key.\n * @param thumbprint\n */\n static generateThrottlingStorageKey(thumbprint: RequestThumbprint): string {\n return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;\n }\n\n /**\n * Performs necessary throttling checks before a network request.\n * @param cacheManager\n * @param thumbprint\n */\n static preProcess(cacheManager: CacheManager, thumbprint: RequestThumbprint): void {\n const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);\n const value = cacheManager.getThrottlingCache(key);\n\n if (value) {\n if (value.throttleTime < Date.now()) {\n cacheManager.removeItem(key, CacheSchemaType.THROTTLING);\n return;\n }\n throw new ServerError(value.errorCodes?.join(\" \") || Constants.EMPTY_STRING, value.errorMessage, value.subError);\n }\n }\n\n /**\n * Performs necessary throttling checks after a network request.\n * @param cacheManager\n * @param thumbprint\n * @param response\n */\n static postProcess(cacheManager: CacheManager, thumbprint: RequestThumbprint, response: NetworkResponse): void {\n if (ThrottlingUtils.checkResponseStatus(response) || ThrottlingUtils.checkResponseForRetryAfter(response)) {\n const thumbprintValue: ThrottlingEntity = {\n throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),\n error: response.body.error,\n errorCodes: response.body.error_codes,\n errorMessage: response.body.error_description,\n subError: response.body.suberror\n };\n cacheManager.setThrottlingCache(\n ThrottlingUtils.generateThrottlingStorageKey(thumbprint),\n thumbprintValue\n );\n }\n }\n\n /**\n * Checks a NetworkResponse object's status codes against 429 or 5xx\n * @param response\n */\n static checkResponseStatus(response: NetworkResponse): boolean {\n return response.status === 429 || response.status >= 500 && response.status < 600;\n }\n\n /**\n * Checks a NetworkResponse object's RetryAfter header\n * @param response\n */\n static checkResponseForRetryAfter(response: NetworkResponse): boolean {\n if (response.headers) {\n return response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) && (response.status < 200 || response.status >= 300);\n }\n return false;\n }\n\n /**\n * Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.\n * @param throttleTime\n */\n static calculateThrottleTime(throttleTime: number): number {\n const time = throttleTime <= 0 ? 0 : throttleTime;\n\n const currentSeconds = Date.now() / 1000;\n return Math.floor(Math.min(\n currentSeconds + (time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS),\n currentSeconds + ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS\n ) * 1000);\n }\n\n static removeThrottle(cacheManager: CacheManager, clientId: string, request: BaseAuthRequest, homeAccountIdentifier?: string): boolean {\n const thumbprint: RequestThumbprint = {\n clientId: clientId,\n authority: request.authority,\n scopes: request.scopes,\n homeAccountIdentifier: homeAccountIdentifier,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n const key = this.generateThrottlingStorageKey(thumbprint);\n return cacheManager.removeItem(key, CacheSchemaType.THROTTLING);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule, NetworkRequestOptions } from \"./INetworkModule\";\nimport { RequestThumbprint } from \"./RequestThumbprint\";\nimport { ThrottlingUtils } from \"./ThrottlingUtils\";\nimport { CacheManager } from \"../cache/CacheManager\";\nimport { AuthError } from \"../error/AuthError\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\n\nexport type NetworkResponse = {\n headers: Record;\n body: T;\n status: number;\n};\n\nexport class NetworkManager {\n private networkClient: INetworkModule;\n private cacheManager: CacheManager;\n\n constructor(networkClient: INetworkModule, cacheManager: CacheManager) {\n this.networkClient = networkClient;\n this.cacheManager = cacheManager;\n }\n\n /**\n * Wraps sendPostRequestAsync with necessary preflight and postflight logic\n * @param thumbprint\n * @param tokenEndpoint\n * @param options\n */\n async sendPostRequest(thumbprint: RequestThumbprint, tokenEndpoint: string, options: NetworkRequestOptions): Promise> {\n ThrottlingUtils.preProcess(this.cacheManager, thumbprint);\n\n let response;\n try {\n response = await this.networkClient.sendPostRequestAsync(tokenEndpoint, options);\n } catch (e) {\n if (e instanceof AuthError) {\n throw e;\n } else {\n throw ClientAuthError.createNetworkError(tokenEndpoint, e);\n }\n }\n\n ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);\n\n return response;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type CcsCredential = {\n credential: string,\n type: CcsCredentialType\n};\n\nexport enum CcsCredentialType {\n HOME_ACCOUNT_ID = \"home_account_id\",\n UPN = \"UPN\"\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfiguration, buildClientConfiguration, CommonClientConfiguration } from \"../config/ClientConfiguration\";\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { NetworkManager, NetworkResponse } from \"../network/NetworkManager\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { Authority } from \"../authority/Authority\";\nimport { Logger } from \"../logger/Logger\";\nimport { Constants, HeaderNames } from \"../utils/Constants\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { CacheManager } from \"../cache/CacheManager\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { version, name } from \"../packageMetadata\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { CcsCredential, CcsCredentialType } from \"../account/CcsCredential\";\nimport { buildClientInfoFromHomeAccountId } from \"../account/ClientInfo\";\nimport { IPerformanceClient } from \"../telemetry/performance/IPerformanceClient\";\n\n/**\n * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.\n */\nexport abstract class BaseClient {\n // Logger object\n public logger: Logger;\n\n // Application config\n protected config: CommonClientConfiguration;\n\n // Crypto Interface\n protected cryptoUtils: ICrypto;\n\n // Storage Interface\n protected cacheManager: CacheManager;\n\n // Network Interface\n protected networkClient: INetworkModule;\n\n // Server Telemetry Manager\n protected serverTelemetryManager: ServerTelemetryManager | null;\n\n // Network Manager\n protected networkManager: NetworkManager;\n\n // Default authority object\n public authority: Authority;\n\n // Performance telemetry client\n protected performanceClient?: IPerformanceClient;\n\n protected constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient) {\n // Set the configuration\n this.config = buildClientConfiguration(configuration);\n\n // Initialize the logger\n this.logger = new Logger(this.config.loggerOptions, name, version);\n\n // Initialize crypto\n this.cryptoUtils = this.config.cryptoInterface;\n\n // Initialize storage interface\n this.cacheManager = this.config.storageInterface;\n\n // Set the network interface\n this.networkClient = this.config.networkInterface;\n\n // Set the NetworkManager\n this.networkManager = new NetworkManager(this.networkClient, this.cacheManager);\n\n // Set TelemetryManager\n this.serverTelemetryManager = this.config.serverTelemetryManager;\n\n // set Authority\n this.authority = this.config.authOptions.authority;\n\n // set performance telemetry client\n this.performanceClient = performanceClient;\n }\n\n /**\n * Creates default headers for requests to token endpoint\n */\n protected createTokenRequestHeaders(ccsCred?: CcsCredential): Record { \n const headers: Record = {};\n headers[HeaderNames.CONTENT_TYPE] = Constants.URL_FORM_CONTENT_TYPE;\n\n if (!this.config.systemOptions.preventCorsPreflight && ccsCred) {\n switch (ccsCred.type) {\n case CcsCredentialType.HOME_ACCOUNT_ID:\n try {\n const clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);\n headers[HeaderNames.CCS_HEADER] = `Oid:${clientInfo.uid}@${clientInfo.utid}`;\n } catch (e) {\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" + e);\n }\n break;\n case CcsCredentialType.UPN:\n headers[HeaderNames.CCS_HEADER] = `UPN: ${ccsCred.credential}`;\n break;\n }\n } \n return headers;\n }\n\n /**\n * Http post to token endpoint\n * @param tokenEndpoint\n * @param queryString\n * @param headers\n * @param thumbprint\n */\n protected async executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record, thumbprint: RequestThumbprint): Promise> {\n const response = await this.networkManager.sendPostRequest(\n thumbprint,\n tokenEndpoint,\n { body: queryString, headers: headers, proxyUrl: this.config.systemOptions.proxyUrl }\n );\n\n if (this.config.serverTelemetryManager && response.status < 500 && response.status !== 429) {\n // Telemetry data successfully logged by server, clear Telemetry cache\n this.config.serverTelemetryManager.clearTelemetryCache();\n }\n\n return response;\n }\n\n /**\n * Updates the authority object of the client. Endpoint discovery must be completed.\n * @param updatedAuthority\n */\n updateAuthority(updatedAuthority: Authority): void {\n if (!updatedAuthority.discoveryComplete()) {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Updated authority has not completed endpoint discovery.\");\n }\n this.authority = updatedAuthority;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { PromptValue, CodeChallengeMethodValues} from \"../utils/Constants\";\nimport { StringDict } from \"../utils/MsalTypes\";\n\n/**\n * Validates server consumable params from the \"request\" objects\n */\nexport class RequestValidator {\n\n /**\n * Utility to check if the `redirectUri` in the request is a non-null value\n * @param redirectUri\n */\n static validateRedirectUri(redirectUri: string) : void {\n if (StringUtils.isEmpty(redirectUri)) {\n throw ClientConfigurationError.createRedirectUriEmptyError();\n }\n }\n\n /**\n * Utility to validate prompt sent by the user in the request\n * @param prompt\n */\n static validatePrompt(prompt: string) : void {\n const promptValues = [];\n\n for (const value in PromptValue) {\n promptValues.push(PromptValue[value]);\n }\n\n if (promptValues.indexOf(prompt) < 0) {\n throw ClientConfigurationError.createInvalidPromptError(prompt);\n }\n }\n\n static validateClaims(claims: string) : void {\n try {\n JSON.parse(claims);\n } catch(e) {\n throw ClientConfigurationError.createInvalidClaimsRequestError();\n }\n }\n\n /**\n * Utility to validate code_challenge and code_challenge_method\n * @param codeChallenge\n * @param codeChallengeMethod\n */\n static validateCodeChallengeParams(codeChallenge: string, codeChallengeMethod: string) : void {\n if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\n } else {\n this.validateCodeChallengeMethod(codeChallengeMethod);\n }\n }\n\n /**\n * Utility to validate code_challenge_method\n * @param codeChallengeMethod\n */\n static validateCodeChallengeMethod(codeChallengeMethod: string) : void {\n if (\n [\n CodeChallengeMethodValues.PLAIN,\n CodeChallengeMethodValues.S256\n ].indexOf(codeChallengeMethod) < 0\n ) {\n throw ClientConfigurationError.createInvalidCodeChallengeMethodError();\n }\n }\n\n /**\n * Removes unnecessary or duplicate query parameters from extraQueryParameters\n * @param request\n */\n static sanitizeEQParams(eQParams: StringDict, queryParams: Map) : StringDict {\n if (!eQParams) {\n return {};\n }\n\n // Remove any query parameters already included in SSO params\n queryParams.forEach((value, key) => {\n if (eQParams[key]) {\n delete eQParams[key];\n }\n });\n\n return eQParams;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AADServerParamKeys, Constants, ResponseMode, SSOTypes, CLIENT_INFO, AuthenticationScheme, ClaimsRequestKeys, PasswordGrantConstants, OIDC_DEFAULT_SCOPES, ThrottlingConstants, HeaderNames} from \"../utils/Constants\";\nimport { ScopeSet } from \"./ScopeSet\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { StringDict } from \"../utils/MsalTypes\";\nimport { RequestValidator } from \"./RequestValidator\";\nimport { ApplicationTelemetry, LibraryInfo } from \"../config/ClientConfiguration\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { ClientInfo } from \"../account/ClientInfo\";\n\nexport class RequestParameterBuilder {\n\n private parameters: Map;\n\n constructor() {\n this.parameters = new Map();\n }\n\n /**\n * add response_type = code\n */\n addResponseTypeCode(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE)\n );\n }\n\n /**\n * add response_type = token id_token\n */\n addResponseTypeForTokenAndIdToken(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(`${Constants.TOKEN_RESPONSE_TYPE} ${Constants.ID_TOKEN_RESPONSE_TYPE}`)\n );\n }\n\n /**\n * add response_mode. defaults to query.\n * @param responseMode\n */\n addResponseMode(responseMode?: ResponseMode): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_MODE,\n encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY)\n );\n }\n\n /**\n * Add flag to indicate STS should attempt to use WAM if available\n */\n addNativeBroker(): void {\n this.parameters.set(\n AADServerParamKeys.NATIVE_BROKER,\n encodeURIComponent(\"1\")\n );\n }\n\n /**\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\n * @param scopeSet\n * @param addOidcScopes\n */\n addScopes(scopes: string[], addOidcScopes: boolean = true): void {\n const requestScopes = addOidcScopes ? [...scopes || [], ...OIDC_DEFAULT_SCOPES] : scopes || [];\n const scopeSet = new ScopeSet(requestScopes);\n this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));\n }\n\n /**\n * add clientId\n * @param clientId\n */\n addClientId(clientId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));\n }\n\n /**\n * add redirect_uri\n * @param redirectUri\n */\n addRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add post logout redirectUri\n * @param redirectUri\n */\n addPostLogoutRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add id_token_hint to logout request\n * @param idTokenHint\n */\n addIdTokenHint(idTokenHint: string): void {\n this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));\n }\n\n /**\n * add domain_hint\n * @param domainHint\n */\n addDomainHint(domainHint: string): void {\n this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));\n }\n\n /**\n * add login_hint\n * @param loginHint\n */\n addLoginHint(loginHint: string): void {\n this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\n * @param loginHint\n */\n addCcsUpn(loginHint: string): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`UPN:${loginHint}`));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for account object\n * @param loginHint\n */\n addCcsOid(clientInfo: ClientInfo): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`Oid:${clientInfo.uid}@${clientInfo.utid}`));\n }\n\n /**\n * add sid\n * @param sid\n */\n addSid(sid: string): void {\n this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));\n }\n\n /**\n * add claims\n * @param claims\n */\n addClaims(claims?: string, clientCapabilities?: Array): void {\n const mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);\n RequestValidator.validateClaims(mergedClaims);\n this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));\n }\n\n /**\n * add correlationId\n * @param correlationId\n */\n addCorrelationId(correlationId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));\n }\n\n /**\n * add library info query params\n * @param libraryInfo\n */\n addLibraryInfo(libraryInfo: LibraryInfo): void {\n // Telemetry Info\n this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);\n this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);\n if (libraryInfo.os) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\n }\n if (libraryInfo.cpu) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\n }\n }\n\n /**\n * Add client telemetry parameters\n * @param appTelemetry\n */\n addApplicationTelemetry(appTelemetry: ApplicationTelemetry): void {\n if (appTelemetry?.appName) {\n this.parameters.set(AADServerParamKeys.X_APP_NAME, appTelemetry.appName);\n }\n\n if (appTelemetry?.appVersion) {\n this.parameters.set(AADServerParamKeys.X_APP_VER, appTelemetry.appVersion);\n }\n }\n\n /**\n * add prompt\n * @param prompt\n */\n addPrompt(prompt: string): void {\n RequestValidator.validatePrompt(prompt);\n this.parameters.set(`${AADServerParamKeys.PROMPT}`, encodeURIComponent(prompt));\n }\n\n /**\n * add state\n * @param state\n */\n addState(state: string): void {\n if (!StringUtils.isEmpty(state)) {\n this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));\n }\n }\n\n /**\n * add nonce\n * @param nonce\n */\n addNonce(nonce: string): void {\n this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));\n }\n\n /**\n * add code_challenge and code_challenge_method\n * - throw if either of them are not passed\n * @param codeChallenge\n * @param codeChallengeMethod\n */\n addCodeChallengeParams(\n codeChallenge: string,\n codeChallengeMethod: string\n ): void {\n RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);\n if (codeChallenge && codeChallengeMethod) {\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));\n } else {\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\n }\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addAuthorizationCode(code: string): void {\n this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addDeviceCode(code: string): void {\n this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `refreshToken` passed by the user\n * @param refreshToken\n */\n addRefreshToken(refreshToken: string): void {\n this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));\n }\n\n /**\n * add the `code_verifier` passed by the user to exchange for a token\n * @param codeVerifier\n */\n addCodeVerifier(codeVerifier: string): void {\n this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));\n }\n\n /**\n * add client_secret\n * @param clientSecret\n */\n addClientSecret(clientSecret: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));\n }\n\n /**\n * add clientAssertion for confidential client flows\n * @param clientAssertion\n */\n addClientAssertion(clientAssertion: string): void {\n if (!StringUtils.isEmpty(clientAssertion)) {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));\n }\n }\n\n /**\n * add clientAssertionType for confidential client flows\n * @param clientAssertionType\n */\n addClientAssertionType(clientAssertionType: string): void {\n if (!StringUtils.isEmpty(clientAssertionType)) {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));\n }\n }\n\n /**\n * add OBO assertion for confidential client flows\n * @param clientAssertion\n */\n addOboAssertion(oboAssertion: string): void {\n this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addRequestTokenUse(tokenUse: string): void {\n this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addGrantType(grantType: string): void {\n this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));\n }\n\n /**\n * add client info\n *\n */\n addClientInfo(): void {\n this.parameters.set(CLIENT_INFO, \"1\");\n }\n\n /**\n * add extraQueryParams\n * @param eQparams\n */\n addExtraQueryParameters(eQparams: StringDict): void {\n RequestValidator.sanitizeEQParams(eQparams, this.parameters);\n Object.keys(eQparams).forEach((key) => {\n this.parameters.set(key, eQparams[key]);\n });\n }\n\n addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array): string {\n let mergedClaims: object;\n\n // Parse provided claims into JSON object or initialize empty object\n if (!claims) {\n mergedClaims = {};\n } else {\n try {\n mergedClaims = JSON.parse(claims);\n } catch(e) {\n throw ClientConfigurationError.createInvalidClaimsRequestError();\n }\n }\n\n if (clientCapabilities && clientCapabilities.length > 0) {\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)){\n // Add access_token key to claims object\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\n }\n\n // Add xms_cc claim with provided clientCapabilities to access_token key\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {\n values: clientCapabilities\n };\n }\n\n return JSON.stringify(mergedClaims);\n }\n\n /**\n * adds `username` for Password Grant flow\n * @param username\n */\n addUsername(username: string): void {\n this.parameters.set(PasswordGrantConstants.username, encodeURIComponent(username));\n }\n\n /**\n * adds `password` for Password Grant flow\n * @param password\n */\n addPassword(password: string): void {\n this.parameters.set(PasswordGrantConstants.password, encodeURIComponent(password));\n }\n\n /**\n * add pop_jwk to query params\n * @param cnfString\n */\n addPopToken(cnfString: string): void {\n if (!StringUtils.isEmpty(cnfString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));\n }\n }\n\n /**\n * add SSH JWK and key ID to query params\n */\n addSshJwk(sshJwkString: string): void {\n if(!StringUtils.isEmpty(sshJwkString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));\n }\n }\n\n /**\n * add server telemetry fields\n * @param serverTelemetryManager\n */\n addServerTelemetry(serverTelemetryManager: ServerTelemetryManager): void {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\n this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\n }\n\n /**\n * Adds parameter that indicates to the server that throttling is supported\n */\n addThrottling(): void {\n this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\n }\n\n /**\n * Adds logout_hint parameter for \"silent\" logout which prevent server account picker\n */\n addLogoutHint(logoutHint: string): void {\n this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));\n }\n\n /**\n * Utility to create a URL from the params map\n */\n createQueryString(): string {\n const queryParameterArray: Array = new Array();\n\n this.parameters.forEach((value, key) => {\n queryParameterArray.push(`${key}=${value}`);\n });\n\n return queryParameterArray.join(\"&\");\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * ID_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * realm: Full tenant or organizational identifier that the account belongs to\n * }\n */\nexport class IdTokenEntity extends CredentialEntity {\n realm: string;\n\n /**\n * Create IdTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createIdTokenEntity(\n homeAccountId: string,\n environment: string,\n idToken: string,\n clientId: string,\n tenantId: string,\n ): IdTokenEntity {\n const idTokenEntity = new IdTokenEntity();\n\n idTokenEntity.credentialType = CredentialType.ID_TOKEN;\n idTokenEntity.homeAccountId = homeAccountId;\n idTokenEntity.environment = environment;\n idTokenEntity.clientId = clientId;\n idTokenEntity.secret = idToken;\n idTokenEntity.realm = tenantId;\n\n return idTokenEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isIdTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.ID_TOKEN\n );\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Utility class which exposes functions for managing date and time operations.\n */\nexport class TimeUtils {\n\n /**\n * return the current time in Unix time (seconds).\n */\n static nowSeconds(): number {\n // Date.getTime() returns in milliseconds.\n return Math.round(new Date().getTime() / 1000.0);\n }\n \n /**\n * check if a token is expired based on given UTC time in seconds.\n * @param expiresOn\n */\n static isTokenExpired(expiresOn: string, offset: number): boolean {\n // check for access token expiry\n const expirationSec = Number(expiresOn) || 0;\n const offsetCurrentTimeSec = TimeUtils.nowSeconds() + offset;\n\n // If current time + offset is greater than token expiration time, then token is expired.\n return (offsetCurrentTimeSec > expirationSec);\n }\n\n /**\n * If the current time is earlier than the time that a token was cached at, we must discard the token\n * i.e. The system clock was turned back after acquiring the cached token\n * @param cachedAt \n * @param offset \n */\n static wasClockTurnedBack(cachedAt: string): boolean {\n const cachedAtSec = Number(cachedAt);\n\n return cachedAtSec > TimeUtils.nowSeconds();\n }\n\n /**\n * Waits for t number of milliseconds\n * @param t number\n * @param value T\n */\n static delay(t: number, value?: T): Promise {\n return new Promise((resolve) => setTimeout(() => resolve(value), t));\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType, AuthenticationScheme } from \"../../utils/Constants\";\nimport { TimeUtils } from \"../../utils/TimeUtils\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { ICrypto } from \"../../crypto/ICrypto\";\nimport { TokenClaims } from \"../../account/TokenClaims\";\nimport { AuthToken } from \"../../account/AuthToken\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * ACCESS_TOKEN Credential Type\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * cachedAt: Absolute device time when entry was created in the cache.\n * expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.\n * extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.\n * keyId: used for POP and SSH tokenTypes\n * tokenType: Type of the token issued. Usually \"Bearer\"\n * }\n */\nexport class AccessTokenEntity extends CredentialEntity {\n realm: string;\n target: string;\n cachedAt: string;\n expiresOn: string;\n extendedExpiresOn?: string;\n refreshOn?: string;\n keyId?: string; // for POP and SSH tokenTypes\n tokenType?: AuthenticationScheme;\n requestedClaims?: string;\n requestedClaimsHash?: string;\n\n /**\n * Create AccessTokenEntity\n * @param homeAccountId\n * @param environment\n * @param accessToken\n * @param clientId\n * @param tenantId\n * @param scopes\n * @param expiresOn\n * @param extExpiresOn\n */\n static createAccessTokenEntity(\n homeAccountId: string,\n environment: string,\n accessToken: string,\n clientId: string,\n tenantId: string,\n scopes: string,\n expiresOn: number,\n extExpiresOn: number,\n cryptoUtils: ICrypto,\n refreshOn?: number,\n tokenType?: AuthenticationScheme,\n userAssertionHash?:string,\n keyId?: string,\n requestedClaims?: string,\n requestedClaimsHash?: string\n ): AccessTokenEntity {\n const atEntity: AccessTokenEntity = new AccessTokenEntity();\n\n atEntity.homeAccountId = homeAccountId;\n atEntity.credentialType = CredentialType.ACCESS_TOKEN;\n atEntity.secret = accessToken;\n\n const currentTime = TimeUtils.nowSeconds();\n atEntity.cachedAt = currentTime.toString();\n\n /*\n * Token expiry time.\n * This value should be  calculated based on the current UTC time measured locally and the value  expires_in Represented as a string in JSON.\n */\n atEntity.expiresOn = expiresOn.toString();\n atEntity.extendedExpiresOn = extExpiresOn.toString();\n if (refreshOn) {\n atEntity.refreshOn = refreshOn.toString();\n }\n\n atEntity.environment = environment;\n atEntity.clientId = clientId;\n atEntity.realm = tenantId;\n atEntity.target = scopes;\n atEntity.userAssertionHash = userAssertionHash;\n\n atEntity.tokenType = StringUtils.isEmpty(tokenType) ? AuthenticationScheme.BEARER : tokenType;\n\n if (requestedClaims) {\n atEntity.requestedClaims = requestedClaims;\n atEntity.requestedClaimsHash = requestedClaimsHash;\n }\n\n /*\n * Create Access Token With Auth Scheme instead of regular access token\n * Cast to lower to handle \"bearer\" from ADFS\n */\n if (atEntity.tokenType?.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) {\n atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\n switch (atEntity.tokenType) {\n case AuthenticationScheme.POP:\n // Make sure keyId is present and add it to credential\n const tokenClaims: TokenClaims | null = AuthToken.extractTokenClaims(accessToken, cryptoUtils);\n if (!tokenClaims?.cnf?.kid) {\n throw ClientAuthError.createTokenClaimsRequiredError();\n }\n atEntity.keyId = tokenClaims.cnf.kid;\n break;\n case AuthenticationScheme.SSH:\n atEntity.keyId = keyId;\n }\n }\n\n return atEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAccessTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity.hasOwnProperty(\"target\") &&\n (entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN || entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME)\n );\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * REFRESH_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--\n *\n * Value:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, '1' represents Microsoft Family\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * }\n */\nexport class RefreshTokenEntity extends CredentialEntity {\n familyId?: string;\n\n /**\n * Create RefreshTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createRefreshTokenEntity(\n homeAccountId: string,\n environment: string,\n refreshToken: string,\n clientId: string,\n familyId?: string,\n userAssertionHash?: string\n ): RefreshTokenEntity {\n const rtEntity = new RefreshTokenEntity();\n\n rtEntity.clientId = clientId;\n rtEntity.credentialType = CredentialType.REFRESH_TOKEN;\n rtEntity.environment = environment;\n rtEntity.homeAccountId = homeAccountId;\n rtEntity.secret = refreshToken;\n rtEntity.userAssertionHash = userAssertionHash;\n\n if (familyId)\n rtEntity.familyId = familyId;\n\n return rtEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isRefreshTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.REFRESH_TOKEN\n );\n }\n}\n","/*\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","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IdTokenEntity } from \"./IdTokenEntity\";\nimport { AccessTokenEntity } from \"./AccessTokenEntity\";\nimport { RefreshTokenEntity } from \"./RefreshTokenEntity\";\nimport { AccountEntity } from \"./AccountEntity\";\nimport { AppMetadataEntity } from \"./AppMetadataEntity\";\n\nexport class CacheRecord {\n account: AccountEntity | null;\n idToken: IdTokenEntity | null;\n accessToken: AccessTokenEntity | null;\n refreshToken: RefreshTokenEntity | null;\n appMetadata: AppMetadataEntity | null;\n\n constructor(accountEntity?: AccountEntity | null, idTokenEntity?: IdTokenEntity | null, accessTokenEntity?: AccessTokenEntity | null, refreshTokenEntity?: RefreshTokenEntity | null, appMetadataEntity?: AppMetadataEntity | null) {\n this.account = accountEntity || null;\n this.idToken = idTokenEntity || null;\n this.accessToken = accessTokenEntity || null;\n this.refreshToken = refreshTokenEntity || null;\n this.appMetadata = appMetadataEntity || null;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StringUtils } from \"./StringUtils\";\nimport { Constants } from \"./Constants\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\n\n/**\n * Type which defines the object that is stringified, encoded and sent in the state value.\n * Contains the following:\n * - id - unique identifier for this request\n * - ts - timestamp for the time the request was made. Used to ensure that token expiration is not calculated incorrectly.\n * - platformState - string value sent from the platform.\n */\nexport type LibraryStateObject = {\n id: string,\n meta?: Record\n};\n\n/**\n * Type which defines the stringified and encoded object sent to the service in the authorize request.\n */\nexport type RequestStateObject = {\n userRequestState: string,\n libraryState: LibraryStateObject\n};\n\n/**\n * Class which provides helpers for OAuth 2.0 protocol specific values\n */\nexport class ProtocolUtils {\n\n /**\n * Appends user state with random guid, or returns random guid.\n * @param userState \n * @param randomGuid \n */\n static setRequestState(cryptoObj: ICrypto, userState?: string, meta?: Record): string {\n const libraryState = ProtocolUtils.generateLibraryState(cryptoObj, meta);\n return !StringUtils.isEmpty(userState) ? `${libraryState}${Constants.RESOURCE_DELIM}${userState}` : libraryState;\n }\n\n /**\n * Generates the state value used by the common library.\n * @param randomGuid \n * @param cryptoObj \n */\n static generateLibraryState(cryptoObj: ICrypto, meta?: Record): string {\n if (!cryptoObj) {\n throw ClientAuthError.createNoCryptoObjectError(\"generateLibraryState\");\n }\n\n // Create a state object containing a unique id and the timestamp of the request creation\n const stateObj: LibraryStateObject = {\n id: cryptoObj.createNewGuid()\n };\n\n if (meta) {\n stateObj.meta = meta;\n }\n\n const stateString = JSON.stringify(stateObj);\n\n return cryptoObj.base64Encode(stateString);\n }\n\n /**\n * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.\n * @param state \n * @param cryptoObj \n */\n static parseRequestState(cryptoObj: ICrypto, state: string): RequestStateObject {\n if (!cryptoObj) {\n throw ClientAuthError.createNoCryptoObjectError(\"parseRequestState\");\n }\n\n if (StringUtils.isEmpty(state)) {\n throw ClientAuthError.createInvalidStateError(state, \"Null, undefined or empty state\");\n }\n\n try {\n // Split the state between library state and user passed state and decode them separately\n const splitState = state.split(Constants.RESOURCE_DELIM);\n const libraryState = splitState[0];\n const userState = splitState.length > 1 ? splitState.slice(1).join(Constants.RESOURCE_DELIM) : Constants.EMPTY_STRING;\n const libraryStateString = cryptoObj.base64Decode(libraryState);\n const libraryStateObj = JSON.parse(libraryStateString) as LibraryStateObject;\n return {\n userRequestState: !StringUtils.isEmpty(userState) ? userState : Constants.EMPTY_STRING,\n libraryState: libraryStateObj\n };\n } catch(e) {\n throw ClientAuthError.createInvalidStateError(state, e);\n }\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerAuthorizationCodeResponse } from \"../response/ServerAuthorizationCodeResponse\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { IUri } from \"./IUri\";\nimport { AADAuthorityConstants, Constants } from \"../utils/Constants\";\n\n/**\n * Url object class which can perform various transformations on url strings.\n */\nexport class UrlString {\n\n // internal url string field\n private _urlString: string;\n public get urlString(): string {\n return this._urlString;\n }\n\n constructor(url: string) {\n this._urlString = url;\n if (StringUtils.isEmpty(this._urlString)) {\n // Throws error if url is empty\n throw ClientConfigurationError.createUrlEmptyError();\n }\n\n if (StringUtils.isEmpty(this.getHash())) {\n this._urlString = UrlString.canonicalizeUri(url);\n }\n }\n\n /**\n * Ensure urls are lower case and end with a / character.\n * @param url\n */\n static canonicalizeUri(url: string): string {\n if (url) {\n let lowerCaseUrl = url.toLowerCase();\n\n if (StringUtils.endsWith(lowerCaseUrl, \"?\")) {\n lowerCaseUrl = lowerCaseUrl.slice(0, -1);\n } else if (StringUtils.endsWith(lowerCaseUrl, \"?/\")) {\n lowerCaseUrl = lowerCaseUrl.slice(0, -2);\n }\n\n if (!StringUtils.endsWith(lowerCaseUrl, \"/\")) {\n lowerCaseUrl += \"/\";\n }\n\n return lowerCaseUrl;\n }\n\n return url;\n }\n\n /**\n * Throws if urlString passed is not a valid authority URI string.\n */\n validateAsUri(): void {\n // Attempts to parse url for uri components\n let components;\n try {\n components = this.getUrlComponents();\n } catch (e) {\n throw ClientConfigurationError.createUrlParseError(e);\n }\n\n // Throw error if URI or path segments are not parseable.\n if (!components.HostNameAndPort || !components.PathSegments) {\n throw ClientConfigurationError.createUrlParseError(`Given url string: ${this.urlString}`);\n }\n\n // Throw error if uri is insecure.\n if(!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\n throw ClientConfigurationError.createInsecureAuthorityUriError(this.urlString);\n }\n }\n\n /**\n * Given a url and a query string return the url with provided query string appended\n * @param url\n * @param queryString\n */\n static appendQueryString(url: string, queryString: string): string {\n if (StringUtils.isEmpty(queryString)) {\n return url;\n }\n\n return url.indexOf(\"?\") < 0 ? `${url}?${queryString}` : `${url}&${queryString}`;\n }\n\n /**\n * Returns a url with the hash removed\n * @param url\n */\n static removeHashFromUrl(url: string): string {\n return UrlString.canonicalizeUri(url.split(\"#\")[0]);\n }\n\n /**\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\n * @param href The url\n * @param tenantId The tenant id to replace\n */\n replaceTenantPath(tenantId: string): UrlString {\n const urlObject = this.getUrlComponents();\n const pathArray = urlObject.PathSegments;\n if (tenantId && (pathArray.length !== 0 && (pathArray[0] === AADAuthorityConstants.COMMON || pathArray[0] === AADAuthorityConstants.ORGANIZATIONS))) {\n pathArray[0] = tenantId;\n }\n return UrlString.constructAuthorityUriFromObject(urlObject);\n }\n\n /**\n * Returns the anchor part(#) of the URL\n */\n getHash(): string {\n return UrlString.parseHash(this.urlString);\n }\n\n /**\n * Parses out the components from a url string.\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\n */\n getUrlComponents(): IUri {\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\n const regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\n\n // If url string does not match regEx, we throw an error\n const match = this.urlString.match(regEx);\n if (!match) {\n throw ClientConfigurationError.createUrlParseError(`Given url string: ${this.urlString}`);\n }\n\n // Url component object\n const urlComponents = {\n Protocol: match[1],\n HostNameAndPort: match[4],\n AbsolutePath: match[5],\n QueryString: match[7]\n } as IUri;\n\n let pathSegments = urlComponents.AbsolutePath.split(\"/\");\n pathSegments = pathSegments.filter((val) => val && val.length > 0); // remove empty elements\n urlComponents.PathSegments = pathSegments;\n\n if (!StringUtils.isEmpty(urlComponents.QueryString) && urlComponents.QueryString.endsWith(\"/\")) {\n urlComponents.QueryString = urlComponents.QueryString.substring(0, urlComponents.QueryString.length-1);\n }\n return urlComponents;\n }\n\n static getDomainFromUrl(url: string): string {\n const regEx = RegExp(\"^([^:/?#]+://)?([^/?#]*)\");\n\n const match = url.match(regEx);\n\n if (!match) {\n throw ClientConfigurationError.createUrlParseError(`Given url string: ${url}`);\n }\n\n return match[2];\n }\n\n static getAbsoluteUrl(relativeUrl: string, baseUrl: string): string {\n if (relativeUrl[0] === Constants.FORWARD_SLASH) {\n const url = new UrlString(baseUrl);\n const baseComponents = url.getUrlComponents();\n\n return baseComponents.Protocol + \"//\" + baseComponents.HostNameAndPort + relativeUrl;\n }\n\n return relativeUrl;\n }\n\n /**\n * Parses hash string from given string. Returns empty string if no hash symbol is found.\n * @param hashString\n */\n static parseHash(hashString: string): string {\n const hashIndex1 = hashString.indexOf(\"#\");\n const hashIndex2 = hashString.indexOf(\"#/\");\n if (hashIndex2 > -1) {\n return hashString.substring(hashIndex2 + 2);\n } else if (hashIndex1 > -1) {\n return hashString.substring(hashIndex1 + 1);\n }\n return Constants.EMPTY_STRING;\n }\n\n /**\n * Parses query string from given string. Returns empty string if no query symbol is found.\n * @param queryString\n */\n static parseQueryString(queryString: string): string {\n const queryIndex1 = queryString.indexOf(\"?\");\n const queryIndex2 = queryString.indexOf(\"/?\");\n if (queryIndex2 > -1) {\n return queryString.substring(queryIndex2 + 2);\n } else if (queryIndex1 > -1) {\n return queryString.substring(queryIndex1 + 1);\n }\n return Constants.EMPTY_STRING;\n }\n\n static constructAuthorityUriFromObject(urlObject: IUri): UrlString {\n return new UrlString(urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + urlObject.PathSegments.join(\"/\"));\n }\n\n /**\n * Returns URL hash as server auth code response object.\n */\n static getDeserializedHash(hash: string): ServerAuthorizationCodeResponse {\n // Check if given hash is empty\n if (StringUtils.isEmpty(hash)) {\n return {};\n }\n // Strip the # symbol if present\n const parsedHash = UrlString.parseHash(hash);\n // If # symbol was not present, above will return empty string, so give original hash value\n const deserializedHash: ServerAuthorizationCodeResponse = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedHash) ? hash : parsedHash);\n // Check if deserialization didn't work\n if (!deserializedHash) {\n throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedHash));\n }\n return deserializedHash;\n }\n\n /**\n * Returns URL query string as server auth code response object.\n */\n static getDeserializedQueryString(query: string): ServerAuthorizationCodeResponse {\n // Check if given query is empty\n if (StringUtils.isEmpty(query)) {\n return {};\n }\n // Strip the ? symbol if present\n const parsedQueryString = UrlString.parseQueryString(query);\n // If ? symbol was not present, above will return empty string, so give original query value\n const deserializedQueryString: ServerAuthorizationCodeResponse = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedQueryString) ? query : parsedQueryString);\n // Check if deserialization didn't work\n if (!deserializedQueryString) {\n throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedQueryString));\n }\n return deserializedQueryString;\n }\n\n /**\n * Check if the hash of the URL string contains known properties\n */\n static hashContainsKnownProperties(hash: string): boolean {\n if (StringUtils.isEmpty(hash) || hash.indexOf(\"=\") < 0) {\n // Hash doesn't contain key/value pairs\n return false;\n }\n\n const parameters: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\n return !!(\n parameters.code ||\n parameters.error_description ||\n parameters.error ||\n parameters.state\n );\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICrypto, SignedHttpRequestParameters } from \"./ICrypto\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { UrlString } from \"../url/UrlString\";\n\n/**\n * See eSTS docs for more info.\n * - A kid element, with the value containing an RFC 7638-compliant JWK thumbprint that is base64 encoded.\n * - xms_ksl element, representing the storage location of the key's secret component on the client device. One of two values:\n * - sw: software storage\n * - uhw: hardware storage\n */\ntype ReqCnf = {\n kid: string;\n xms_ksl: KeyLocation;\n};\n\nexport type ReqCnfData = {\n kid: string;\n reqCnfString: string;\n reqCnfHash: string;\n};\n\nenum KeyLocation {\n SW = \"sw\",\n UHW = \"uhw\"\n}\n\nexport class PopTokenGenerator {\n\n private cryptoUtils: ICrypto;\n\n constructor(cryptoUtils: ICrypto) {\n this.cryptoUtils = cryptoUtils;\n }\n\n /**\n * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters\n * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash\n * @param request\n * @returns\n */\n async generateCnf(request: SignedHttpRequestParameters): Promise {\n const reqCnf = await this.generateKid(request);\n const reqCnfString: string = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));\n\n return {\n kid: reqCnf.kid,\n reqCnfString, \n reqCnfHash: await this.cryptoUtils.hashString(reqCnfString) \n };\n }\n\n /**\n * Generates key_id for a SHR token request\n * @param request\n * @returns\n */\n async generateKid(request: SignedHttpRequestParameters): Promise {\n const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);\n\n return {\n kid: kidThumbprint,\n xms_ksl: KeyLocation.SW\n };\n }\n\n /**\n * Signs the POP access_token with the local generated key-pair\n * @param accessToken\n * @param request\n * @returns\n */\n async signPopToken(accessToken: string, keyId: string, request: SignedHttpRequestParameters): Promise {\n return this.signPayload(accessToken, keyId, request);\n }\n\n /**\n * Utility function to generate the signed JWT for an access_token\n * @param payload\n * @param kid\n * @param request\n * @param claims\n * @returns\n */\n async signPayload(payload: string, keyId: string, request: SignedHttpRequestParameters, claims?: object): Promise {\n\n // Deconstruct request to extract SHR parameters\n const { resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce } = request;\n\n const resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;\n const resourceUrlComponents = resourceUrlString?.getUrlComponents();\n return await this.cryptoUtils.signJwt({\n at: payload,\n ts: TimeUtils.nowSeconds(),\n m: resourceRequestMethod?.toUpperCase(),\n u: resourceUrlComponents?.HostNameAndPort,\n nonce: shrNonce || this.cryptoUtils.createNewGuid(),\n p: resourceUrlComponents?.AbsolutePath,\n q: (resourceUrlComponents?.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined,\n client_claims: shrClaims || undefined,\n ...claims\n }, keyId, request.correlationId);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { APP_METADATA, Separators } from \"../../utils/Constants\";\n\n/**\n * APP_METADATA Cache\n *\n * Key:Value Schema:\n *\n * Key: appmetadata--\n *\n * Value:\n * {\n * clientId: client ID of the application\n * environment: entity that issued the token, represented as a full host\n * familyId: Family ID identifier, '1' represents Microsoft Family\n * }\n */\nexport class AppMetadataEntity {\n clientId: string;\n environment: string;\n familyId?: string;\n\n /**\n * Generate AppMetadata Cache Key as per the schema: appmetadata--\n */\n generateAppMetadataKey(): string {\n return AppMetadataEntity.generateAppMetadataCacheKey(this.environment, this.clientId);\n }\n\n /**\n * Generate AppMetadata Cache Key\n */\n static generateAppMetadataCacheKey(environment: string, clientId: string): string {\n const appMetaDataKeyArray: Array = [\n APP_METADATA,\n environment,\n clientId,\n ];\n return appMetaDataKeyArray.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Creates AppMetadataEntity\n * @param clientId\n * @param environment\n * @param familyId\n */\n static createAppMetadataEntity(clientId: string, environment: string, familyId?: string): AppMetadataEntity {\n const appMetadata = new AppMetadataEntity();\n\n appMetadata.clientId = clientId;\n appMetadata.environment = environment;\n if (familyId) {\n appMetadata.familyId = familyId;\n }\n\n return appMetadata;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAppMetadataEntity(key: string, entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n key.indexOf(APP_METADATA) === 0 &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"environment\")\n );\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISerializableTokenCache } from \"../interface/ISerializableTokenCache\";\n\n/**\n * This class instance helps track the memory changes facilitating\n * decisions to read from and write to the persistent cache\n */export class TokenCacheContext {\n /**\n * boolean indicating cache change\n */\n hasChanged: boolean;\n /**\n * serializable token cache interface\n */\n cache: ISerializableTokenCache;\n\n constructor(tokenCache: ISerializableTokenCache, hasChanged: boolean) {\n this.cache = tokenCache;\n this.hasChanged = hasChanged;\n }\n\n /**\n * boolean which indicates the changes in cache\n */\n get cacheHasChanged(): boolean {\n return this.hasChanged;\n }\n\n /**\n * function to retrieve the token cache\n */\n get tokenCache(): ISerializableTokenCache {\n return this.cache;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerAuthorizationTokenResponse } from \"./ServerAuthorizationTokenResponse\";\nimport { buildClientInfo} from \"../account/ClientInfo\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerAuthorizationCodeResponse } from \"./ServerAuthorizationCodeResponse\";\nimport { Logger } from \"../logger/Logger\";\nimport { ServerError } from \"../error/ServerError\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { AuthenticationResult } from \"./AuthenticationResult\";\nimport { AccountEntity } from \"../cache/entities/AccountEntity\";\nimport { Authority } from \"../authority/Authority\";\nimport { AuthorityType } from \"../authority/AuthorityType\";\nimport { IdTokenEntity } from \"../cache/entities/IdTokenEntity\";\nimport { AccessTokenEntity } from \"../cache/entities/AccessTokenEntity\";\nimport { RefreshTokenEntity } from \"../cache/entities/RefreshTokenEntity\";\nimport { InteractionRequiredAuthError } from \"../error/InteractionRequiredAuthError\";\nimport { CacheRecord } from \"../cache/entities/CacheRecord\";\nimport { CacheManager } from \"../cache/CacheManager\";\nimport { ProtocolUtils, RequestStateObject } from \"../utils/ProtocolUtils\";\nimport { AuthenticationScheme, Constants, THE_FAMILY_ID } from \"../utils/Constants\";\nimport { PopTokenGenerator } from \"../crypto/PopTokenGenerator\";\nimport { AppMetadataEntity } from \"../cache/entities/AppMetadataEntity\";\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\nimport { TokenCacheContext } from \"../cache/persistence/TokenCacheContext\";\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\nimport { AuthorizationCodePayload } from \"./AuthorizationCodePayload\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\n/**\n * Class that handles response parsing.\n */\nexport class ResponseHandler {\n private clientId: string;\n private cacheStorage: CacheManager;\n private cryptoObj: ICrypto;\n private logger: Logger;\n private homeAccountIdentifier: string;\n private serializableCache: ISerializableTokenCache | null;\n private persistencePlugin: ICachePlugin | null;\n\n constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null) {\n this.clientId = clientId;\n this.cacheStorage = cacheStorage;\n this.cryptoObj = cryptoObj;\n this.logger = logger;\n this.serializableCache = serializableCache;\n this.persistencePlugin = persistencePlugin;\n }\n\n /**\n * Function which validates server authorization code response.\n * @param serverResponseHash\n * @param cachedState\n * @param cryptoObj\n */\n validateServerAuthorizationCodeResponse(serverResponseHash: ServerAuthorizationCodeResponse, cachedState: string, cryptoObj: ICrypto): void {\n\n if (!serverResponseHash.state || !cachedState) {\n throw !serverResponseHash.state ? ClientAuthError.createStateNotFoundError(\"Server State\") : ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n if (decodeURIComponent(serverResponseHash.state) !== decodeURIComponent(cachedState)) {\n throw ClientAuthError.createStateMismatchError();\n }\n\n // Check for error\n if (serverResponseHash.error || serverResponseHash.error_description || serverResponseHash.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponseHash.error, serverResponseHash.error_description, serverResponseHash.suberror)) {\n throw new InteractionRequiredAuthError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n throw new ServerError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n if (serverResponseHash.client_info) {\n buildClientInfo(serverResponseHash.client_info, cryptoObj);\n }\n }\n\n /**\n * Function which validates server authorization token response.\n * @param serverResponse\n */\n validateTokenResponse(serverResponse: ServerAuthorizationTokenResponse): void {\n // Check for error\n if (serverResponse.error || serverResponse.error_description || serverResponse.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {\n throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror);\n }\n\n const errString = `${serverResponse.error_codes} - [${serverResponse.timestamp}]: ${serverResponse.error_description} - Correlation ID: ${serverResponse.correlation_id} - Trace ID: ${serverResponse.trace_id}`;\n throw new ServerError(serverResponse.error, errString, serverResponse.suberror);\n }\n }\n\n /**\n * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.\n * @param serverTokenResponse\n * @param authority\n */\n async handleServerTokenResponse(\n serverTokenResponse: ServerAuthorizationTokenResponse,\n authority: Authority,\n reqTimestamp: number,\n request: BaseAuthRequest,\n authCodePayload?: AuthorizationCodePayload,\n userAssertionHash?: string,\n handlingRefreshTokenResponse?: boolean,\n forceCacheRefreshTokenResponse?: boolean,\n serverRequestId?: string): Promise {\n\n // create an idToken object (not entity)\n let idTokenObj: AuthToken | undefined;\n if (serverTokenResponse.id_token) {\n idTokenObj = new AuthToken(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj);\n\n // token nonce check (TODO: Add a warning if no nonce is given?)\n if (authCodePayload && !StringUtils.isEmpty(authCodePayload.nonce)) {\n if (idTokenObj.claims.nonce !== authCodePayload.nonce) {\n throw ClientAuthError.createNonceMismatchError();\n }\n }\n\n // token max_age check\n if (request.maxAge || (request.maxAge === 0)) {\n const authTime = idTokenObj.claims.auth_time;\n if (!authTime) {\n throw ClientAuthError.createAuthTimeNotFoundError();\n }\n\n AuthToken.checkMaxAge(authTime, request.maxAge);\n }\n }\n\n // generate homeAccountId\n this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj);\n\n // save the response tokens\n let requestStateObj: RequestStateObject | undefined;\n if (!!authCodePayload && !!authCodePayload.state) {\n requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);\n }\n\n // Add keyId from request to serverTokenResponse if defined\n serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;\n\n const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);\n let cacheContext;\n try {\n if (this.persistencePlugin && this.serializableCache) {\n this.logger.verbose(\"Persistence enabled, calling beforeCacheAccess\");\n cacheContext = new TokenCacheContext(this.serializableCache, true);\n await this.persistencePlugin.beforeCacheAccess(cacheContext);\n }\n /*\n * When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.\n * If not present, we should return null, as it's the case that another application called removeAccount in between\n * the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal, unless explicitly flagged by\n * the developer, as in the case of refresh token flow used in ADAL Node to MSAL Node migration.\n */\n if (handlingRefreshTokenResponse && !forceCacheRefreshTokenResponse && cacheRecord.account) {\n const key = cacheRecord.account.generateAccountKey();\n const account = this.cacheStorage.getAccount(key);\n if (!account) {\n this.logger.warning(\"Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache\");\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, undefined, serverRequestId);\n }\n }\n await this.cacheStorage.saveCacheRecord(cacheRecord);\n } finally {\n if (this.persistencePlugin && this.serializableCache && cacheContext) {\n this.logger.verbose(\"Persistence enabled, calling afterCacheAccess\");\n await this.persistencePlugin.afterCacheAccess(cacheContext);\n }\n }\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, serverTokenResponse.spa_code, serverRequestId);\n }\n\n /**\n * Generates CacheRecord\n * @param serverTokenResponse\n * @param idTokenObj\n * @param authority\n */\n private generateCacheRecord(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, idTokenObj?: AuthToken, userAssertionHash?: string, authCodePayload?: AuthorizationCodePayload): CacheRecord {\n const env = authority.getPreferredCache();\n if (StringUtils.isEmpty(env)) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n // IdToken: non AAD scenarios can have empty realm\n let cachedIdToken: IdTokenEntity | undefined;\n let cachedAccount: AccountEntity | undefined;\n if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {\n cachedIdToken = IdTokenEntity.createIdTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.id_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj.claims.tid || Constants.EMPTY_STRING,\n );\n\n cachedAccount = this.generateAccountEntity(\n serverTokenResponse,\n idTokenObj,\n authority,\n authCodePayload\n );\n }\n\n // AccessToken\n let cachedAccessToken: AccessTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {\n\n // If scopes not returned in server response, use request scopes\n const responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);\n\n /*\n * Use timestamp calculated before request\n * Server may return timestamps as strings, parse to numbers if so.\n */\n const expiresIn: number = (typeof serverTokenResponse.expires_in === \"string\" ? parseInt(serverTokenResponse.expires_in, 10) : serverTokenResponse.expires_in) || 0;\n const extExpiresIn: number = (typeof serverTokenResponse.ext_expires_in === \"string\" ? parseInt(serverTokenResponse.ext_expires_in, 10) : serverTokenResponse.ext_expires_in) || 0;\n const refreshIn: number | undefined = (typeof serverTokenResponse.refresh_in === \"string\" ? parseInt(serverTokenResponse.refresh_in, 10) : serverTokenResponse.refresh_in) || undefined;\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\n const extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;\n const refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;\n\n // non AAD scenarios can have empty realm\n cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.access_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant,\n responseScopes.printScopes(),\n tokenExpirationSeconds,\n extendedTokenExpirationSeconds,\n this.cryptoObj,\n refreshOnSeconds,\n serverTokenResponse.token_type,\n userAssertionHash,\n serverTokenResponse.key_id,\n request.claims,\n request.requestedClaimsHash\n );\n }\n\n // refreshToken\n let cachedRefreshToken: RefreshTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {\n cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.refresh_token || Constants.EMPTY_STRING,\n this.clientId,\n serverTokenResponse.foci,\n userAssertionHash\n );\n }\n\n // appMetadata\n let cachedAppMetadata: AppMetadataEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.foci)) {\n cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);\n }\n\n return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);\n }\n\n /**\n * Generate Account\n * @param serverTokenResponse\n * @param idToken\n * @param authority\n */\n private generateAccountEntity(serverTokenResponse: ServerAuthorizationTokenResponse, idToken: AuthToken, authority: Authority, authCodePayload?: AuthorizationCodePayload): AccountEntity {\n const authorityType = authority.authorityType;\n const cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;\n const msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;\n\n // ADFS does not require client_info in the response\n if (authorityType === AuthorityType.Adfs) {\n this.logger.verbose(\"Authority type is ADFS, creating ADFS account\");\n return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\n }\n\n // This fallback applies to B2C as well as they fall under an AAD account type.\n if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === \"AAD\") {\n throw ClientAuthError.createClientInfoEmptyError();\n }\n\n return serverTokenResponse.client_info ?\n AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :\n AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\n }\n\n /**\n * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.\n *\n * Optionally takes a state string that is set as-is in the response.\n *\n * @param cacheRecord\n * @param idTokenObj\n * @param fromTokenCache\n * @param stateString\n */\n static async generateAuthenticationResult(\n cryptoObj: ICrypto,\n authority: Authority,\n cacheRecord: CacheRecord,\n fromTokenCache: boolean,\n request: BaseAuthRequest,\n idTokenObj?: AuthToken,\n requestState?: RequestStateObject,\n code?: string,\n requestId?: string\n ): Promise {\n let accessToken: string = Constants.EMPTY_STRING;\n let responseScopes: Array = [];\n let expiresOn: Date | null = null;\n let extExpiresOn: Date | undefined;\n let familyId: string = Constants.EMPTY_STRING;\n\n if (cacheRecord.accessToken) {\n if (cacheRecord.accessToken.tokenType === AuthenticationScheme.POP) {\n const popTokenGenerator: PopTokenGenerator = new PopTokenGenerator(cryptoObj);\n const { secret, keyId } = cacheRecord.accessToken;\n\n if (!keyId) {\n throw ClientAuthError.createKeyIdMissingError();\n }\n\n accessToken = await popTokenGenerator.signPopToken(secret, keyId, request);\n } else {\n accessToken = cacheRecord.accessToken.secret;\n }\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\n }\n\n if (cacheRecord.appMetadata) {\n familyId = cacheRecord.appMetadata.familyId === THE_FAMILY_ID ? THE_FAMILY_ID : Constants.EMPTY_STRING;\n }\n const uid = idTokenObj?.claims.oid || idTokenObj?.claims.sub || Constants.EMPTY_STRING;\n const tid = idTokenObj?.claims.tid || Constants.EMPTY_STRING;\n\n return {\n authority: authority.canonicalAuthority,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes,\n account: cacheRecord.account ? cacheRecord.account.getAccountInfo() : null,\n idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,\n idTokenClaims: idTokenObj ? idTokenObj.claims : {},\n accessToken: accessToken,\n fromCache: fromTokenCache,\n expiresOn: expiresOn,\n correlationId: request.correlationId,\n requestId: requestId || Constants.EMPTY_STRING,\n extExpiresOn: extExpiresOn,\n familyId: familyId,\n tokenType: cacheRecord.accessToken?.tokenType || Constants.EMPTY_STRING,\n state: requestState ? requestState.userRequestState : Constants.EMPTY_STRING,\n cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || Constants.EMPTY_STRING,\n msGraphHost: cacheRecord.account?.msGraphHost || Constants.EMPTY_STRING,\n code,\n fromNativeBroker: false\n };\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BaseClient } from \"./BaseClient\";\nimport { CommonAuthorizationUrlRequest } from \"../request/CommonAuthorizationUrlRequest\";\nimport { CommonAuthorizationCodeRequest } from \"../request/CommonAuthorizationCodeRequest\";\nimport { Authority } from \"../authority/Authority\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { GrantType, AuthenticationScheme, PromptValue, Separators, AADServerParamKeys, HeaderNames } from \"../utils/Constants\";\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { NetworkResponse } from \"../network/NetworkManager\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { UrlString } from \"../url/UrlString\";\nimport { ServerAuthorizationCodeResponse } from \"../response/ServerAuthorizationCodeResponse\";\nimport { CommonEndSessionRequest } from \"../request/CommonEndSessionRequest\";\nimport { PopTokenGenerator } from \"../crypto/PopTokenGenerator\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { AuthorizationCodePayload } from \"../response/AuthorizationCodePayload\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { AccountInfo } from \"../account/AccountInfo\";\nimport { buildClientInfoFromHomeAccountId, buildClientInfo } from \"../account/ClientInfo\";\nimport { CcsCredentialType, CcsCredential } from \"../account/CcsCredential\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { RequestValidator } from \"../request/RequestValidator\";\n\n/**\n * Oauth2.0 Authorization Code client\n */\nexport class AuthorizationCodeClient extends BaseClient {\n // Flag to indicate if client is for hybrid spa auth code redemption\n protected includeRedirectUri: boolean = true;\n\n constructor(configuration: ClientConfiguration) {\n super(configuration);\n }\n\n /**\n * Creates the URL of the authorization request letting the user input credentials and consent to the\n * application. The URL target the /authorize endpoint of the authority configured in the\n * application object.\n *\n * Once the user inputs their credentials and consents, the authority will send a response to the redirect URI\n * sent in the request and should contain an authorization code, which can then be used to acquire tokens via\n * acquireToken(AuthorizationCodeRequest)\n * @param request\n */\n async getAuthCodeUrl(request: CommonAuthorizationUrlRequest): Promise {\n const queryString = await this.createAuthCodeUrlQueryString(request);\n\n return UrlString.appendQueryString(this.authority.authorizationEndpoint, queryString);\n }\n\n /**\n * API to acquire a token in exchange of 'authorization_code` acquired by the user in the first leg of the\n * authorization_code_grant\n * @param request\n */\n async acquireToken(request: CommonAuthorizationCodeRequest, authCodePayload?: AuthorizationCodePayload): Promise {\n this.logger.info(\"in acquireToken call\");\n if (!request || StringUtils.isEmpty(request.code)) {\n throw ClientAuthError.createTokenRequestCannotBeMadeError();\n }\n\n const reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.executeTokenRequest(this.authority, request);\n\n // Retrieve requestId from response headers\n const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n // Validate response. This function throws a server error if an error is returned by the server.\n responseHandler.validateTokenResponse(response.body);\n return await responseHandler.handleServerTokenResponse(\n response.body, \n this.authority, \n reqTimestamp, \n request, \n authCodePayload,\n undefined,\n undefined,\n undefined,\n requestId\n );\n }\n\n /**\n * Handles the hash fragment response from public client code request. Returns a code response used by\n * the client to exchange for a token in acquireToken.\n * @param hashFragment\n */\n handleFragmentResponse(hashFragment: string, cachedState: string): AuthorizationCodePayload {\n // Handle responses.\n const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, null, null);\n\n // Deserialize hash fragment response parameters.\n const hashUrlString = new UrlString(hashFragment);\n // Deserialize hash fragment response parameters.\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hashUrlString.getHash());\n\n // Get code response\n responseHandler.validateServerAuthorizationCodeResponse(serverParams, cachedState, this.cryptoUtils);\n\n // throw when there is no auth code in the response\n if (!serverParams.code) {\n throw ClientAuthError.createNoAuthCodeInServerResponseError();\n }\n return {\n ...serverParams,\n // Code param is optional in ServerAuthorizationCodeResponse but required in AuthorizationCodePaylod\n code: serverParams.code\n };\n }\n\n /**\n * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param authorityUri\n */\n getLogoutUri(logoutRequest: CommonEndSessionRequest): string {\n // Throw error if logoutRequest is null/undefined\n if (!logoutRequest) {\n throw ClientConfigurationError.createEmptyLogoutRequestError();\n }\n const queryString = this.createLogoutUrlQueryString(logoutRequest);\n\n // Construct logout URI\n return UrlString.appendQueryString(this.authority.endSessionEndpoint, queryString);\n }\n\n /**\n * Executes POST request to token endpoint\n * @param authority\n * @param request\n */\n private async executeTokenRequest(authority: Authority, request: CommonAuthorizationCodeRequest): Promise> {\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: authority.canonicalAuthority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n const requestBody = await this.createTokenRequestBody(request);\n const queryParameters = this.createTokenQueryParameters(request);\n let ccsCredential: CcsCredential | undefined = undefined;\n if (request.clientInfo) {\n try {\n const clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);\n ccsCredential = {\n credential: `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`,\n type: CcsCredentialType.HOME_ACCOUNT_ID\n };\n } catch (e) {\n this.logger.verbose(\"Could not parse client info for CCS Header: \" + e);\n }\n }\n const headers: Record = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);\n const endpoint = StringUtils.isEmpty(queryParameters) ? authority.tokenEndpoint : `${authority.tokenEndpoint}?${queryParameters}`;\n\n return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);\n }\n\n /**\n * Creates query string for the /token request\n * @param request\n */\n private createTokenQueryParameters(request: CommonAuthorizationCodeRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n if (request.tokenQueryParameters) {\n parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * Generates a map for all the params to be sent to the service\n * @param request\n */\n private async createTokenRequestBody(request: CommonAuthorizationCodeRequest): Promise {\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n /*\n * For hybrid spa flow, there will be a code but no verifier\n * In this scenario, don't include redirect uri as auth code will not be bound to redirect URI\n */\n if (!this.includeRedirectUri) {\n // Just validate\n RequestValidator.validateRedirectUri(request.redirectUri);\n } else {\n // Validate and include redirect uri\n parameterBuilder.addRedirectUri(request.redirectUri);\n }\n\n // Add scope array, parameter builder will add default scopes and dedupe\n parameterBuilder.addScopes(request.scopes);\n\n // add code: user set, not validated\n parameterBuilder.addAuthorizationCode(request.code);\n\n // Add library metadata\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n parameterBuilder.addThrottling();\n\n if (this.serverTelemetryManager) {\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\n }\n\n // add code_verifier if passed\n if (request.codeVerifier) {\n parameterBuilder.addCodeVerifier(request.codeVerifier);\n }\n\n if (this.config.clientCredentials.clientSecret) {\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\n }\n\n if (this.config.clientCredentials.clientAssertion) {\n const clientAssertion = this.config.clientCredentials.clientAssertion;\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\n }\n\n parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);\n parameterBuilder.addClientInfo();\n\n if (request.authenticationScheme === AuthenticationScheme.POP) {\n const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);\n const reqCnfData = await popTokenGenerator.generateCnf(request);\n // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)\n parameterBuilder.addPopToken(reqCnfData.reqCnfString);\n } else if (request.authenticationScheme === AuthenticationScheme.SSH) {\n if(request.sshJwk) {\n parameterBuilder.addSshJwk(request.sshJwk);\n } else {\n throw ClientConfigurationError.createMissingSshJwkError();\n }\n }\n\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n parameterBuilder.addCorrelationId(correlationId);\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n let ccsCred: CcsCredential | undefined = undefined;\n if (request.clientInfo) {\n try {\n const clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);\n ccsCred = {\n credential: `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`,\n type: CcsCredentialType.HOME_ACCOUNT_ID\n };\n } catch (e) {\n this.logger.verbose(\"Could not parse client info for CCS Header: \" + e);\n }\n } else {\n ccsCred = request.ccsCredential;\n }\n\n // Adds these as parameters in the request instead of headers to prevent CORS preflight request\n if (this.config.systemOptions.preventCorsPreflight && ccsCred) {\n switch (ccsCred.type) {\n case CcsCredentialType.HOME_ACCOUNT_ID:\n try {\n const clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);\n parameterBuilder.addCcsOid(clientInfo);\n } catch (e) {\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" + e);\n }\n break;\n case CcsCredentialType.UPN:\n parameterBuilder.addCcsUpn(ccsCred.credential);\n break;\n }\n }\n\n if (request.tokenBodyParameters) {\n parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);\n }\n\n // Add hybrid spa parameters if not already provided\n if (request.enableSpaAuthorizationCode && (!request.tokenBodyParameters || !request.tokenBodyParameters[AADServerParamKeys.RETURN_SPA_CODE])) {\n parameterBuilder.addExtraQueryParameters({\n [AADServerParamKeys.RETURN_SPA_CODE]: \"1\"\n });\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * This API validates the `AuthorizationCodeUrlRequest` and creates a URL\n * @param request\n */\n private async createAuthCodeUrlQueryString(request: CommonAuthorizationUrlRequest): Promise {\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n const requestScopes = [...request.scopes || [], ...request.extraScopesToConsent || []];\n parameterBuilder.addScopes(requestScopes);\n\n // validate the redirectUri (to be a non null value)\n parameterBuilder.addRedirectUri(request.redirectUri);\n\n // generate the correlationId if not set by the user and add\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n parameterBuilder.addCorrelationId(correlationId);\n\n // add response_mode. If not passed in it defaults to query.\n parameterBuilder.addResponseMode(request.responseMode);\n\n // add response_type = code\n parameterBuilder.addResponseTypeCode();\n\n // add library info parameters\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n\n // add client_info=1\n parameterBuilder.addClientInfo();\n\n if (request.codeChallenge && request.codeChallengeMethod) {\n parameterBuilder.addCodeChallengeParams(request.codeChallenge, request.codeChallengeMethod);\n }\n\n if (request.prompt) {\n parameterBuilder.addPrompt(request.prompt);\n }\n\n if (request.domainHint) {\n parameterBuilder.addDomainHint(request.domainHint);\n }\n\n // Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object\n if (request.prompt !== PromptValue.SELECT_ACCOUNT) {\n // AAD will throw if prompt=select_account is passed with an account hint\n if (request.sid && request.prompt === PromptValue.NONE) {\n // SessionID is only used in silent calls\n this.logger.verbose(\"createAuthCodeUrlQueryString: Prompt is none, adding sid from request\");\n parameterBuilder.addSid(request.sid);\n } else if (request.account) {\n const accountSid = this.extractAccountSid(request.account);\n const accountLoginHintClaim = this.extractLoginHint(request.account);\n // If login_hint claim is present, use it over sid/username\n if (accountLoginHintClaim) {\n this.logger.verbose(\"createAuthCodeUrlQueryString: login_hint claim present on account\");\n parameterBuilder.addLoginHint(accountLoginHintClaim);\n try {\n const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\n parameterBuilder.addCcsOid(clientInfo);\n } catch (e) {\n this.logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\n }\n } else if (accountSid && request.prompt === PromptValue.NONE) {\n /*\n * If account and loginHint are provided, we will check account first for sid before adding loginHint\n * SessionId is only used in silent calls\n */\n this.logger.verbose(\"createAuthCodeUrlQueryString: Prompt is none, adding sid from account\");\n parameterBuilder.addSid(accountSid);\n try {\n const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\n parameterBuilder.addCcsOid(clientInfo);\n } catch (e) {\n this.logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\n }\n } else if (request.loginHint) {\n this.logger.verbose(\"createAuthCodeUrlQueryString: Adding login_hint from request\");\n parameterBuilder.addLoginHint(request.loginHint);\n parameterBuilder.addCcsUpn(request.loginHint);\n } else if (request.account.username) {\n // Fallback to account username if provided\n this.logger.verbose(\"createAuthCodeUrlQueryString: Adding login_hint from account\");\n parameterBuilder.addLoginHint(request.account.username);\n try {\n const clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\n parameterBuilder.addCcsOid(clientInfo);\n } catch (e) {\n this.logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\n }\n }\n } else if (request.loginHint) {\n this.logger.verbose(\"createAuthCodeUrlQueryString: No account, adding login_hint from request\");\n parameterBuilder.addLoginHint(request.loginHint);\n parameterBuilder.addCcsUpn(request.loginHint);\n }\n } else {\n this.logger.verbose(\"createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints\");\n }\n\n if (request.nonce) {\n parameterBuilder.addNonce(request.nonce);\n }\n\n if (request.state) {\n parameterBuilder.addState(request.state);\n }\n\n if (!StringUtils.isEmpty(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n if (request.extraQueryParameters) {\n parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);\n }\n\n if (request.nativeBroker) {\n // signal ests that this is a WAM call\n parameterBuilder.addNativeBroker();\n\n // pass the req_cnf for POP\n if (request.authenticationScheme === AuthenticationScheme.POP) {\n const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);\n // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string\n const reqCnfData = await popTokenGenerator.generateCnf(request);\n parameterBuilder.addPopToken(reqCnfData.reqCnfHash);\n }\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * This API validates the `EndSessionRequest` and creates a URL\n * @param request\n */\n private createLogoutUrlQueryString(request: CommonEndSessionRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n if (request.postLogoutRedirectUri) {\n parameterBuilder.addPostLogoutRedirectUri(request.postLogoutRedirectUri);\n }\n\n if (request.correlationId) {\n parameterBuilder.addCorrelationId(request.correlationId);\n }\n\n if (request.idTokenHint) {\n parameterBuilder.addIdTokenHint(request.idTokenHint);\n }\n\n if(request.state) {\n parameterBuilder.addState(request.state);\n }\n\n if (request.logoutHint) {\n parameterBuilder.addLogoutHint(request.logoutHint);\n }\n\n if (request.extraQueryParameters) {\n parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * Helper to get sid from account. Returns null if idTokenClaims are not present or sid is not present.\n * @param account\n */\n private extractAccountSid(account: AccountInfo): string | null {\n return account.idTokenClaims?.sid || null;\n }\n\n private extractLoginHint(account: AccountInfo): string | null {\n return account.idTokenClaims?.login_hint || null;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DeviceCodeResponse, ServerDeviceCodeResponse } from \"../response/DeviceCodeResponse\";\nimport { BaseClient } from \"./BaseClient\";\nimport { CommonDeviceCodeRequest } from \"../request/CommonDeviceCodeRequest\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { Constants, GrantType } from \"../utils/Constants\";\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { ServerError } from \"../error/ServerError\";\n\n/**\n * OAuth2.0 Device code client\n */\nexport class DeviceCodeClient extends BaseClient {\n\n constructor(configuration: ClientConfiguration) {\n super(configuration);\n }\n\n /**\n * Gets device code from device code endpoint, calls back to with device code response, and\n * polls token endpoint to exchange device code for tokens\n * @param request\n */\n public async acquireToken(request: CommonDeviceCodeRequest): Promise {\n const deviceCodeResponse: DeviceCodeResponse = await this.getDeviceCode(request);\n request.deviceCodeCallback(deviceCodeResponse);\n const reqTimestamp = TimeUtils.nowSeconds();\n const response: ServerAuthorizationTokenResponse = await this.acquireTokenWithDeviceCode(\n request,\n deviceCodeResponse);\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n // Validate response. This function throws a server error if an error is returned by the server.\n responseHandler.validateTokenResponse(response);\n return await responseHandler.handleServerTokenResponse(\n response,\n this.authority,\n reqTimestamp,\n request\n );\n }\n\n /**\n * Creates device code request and executes http GET\n * @param request\n */\n private async getDeviceCode(request: CommonDeviceCodeRequest): Promise {\n const queryString = this.createQueryString(request);\n const headers = this.createTokenRequestHeaders();\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: request.authority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n return this.executePostRequestToDeviceCodeEndpoint(this.authority.deviceCodeEndpoint, queryString, headers, thumbprint);\n }\n\n /**\n * Executes POST request to device code endpoint\n * @param deviceCodeEndpoint\n * @param queryString\n * @param headers\n */\n private async executePostRequestToDeviceCodeEndpoint(\n deviceCodeEndpoint: string,\n queryString: string,\n headers: Record,\n thumbprint: RequestThumbprint): Promise {\n\n const {\n body: {\n user_code: userCode,\n device_code: deviceCode,\n verification_uri: verificationUri,\n expires_in: expiresIn,\n interval,\n message\n }\n } = await this.networkManager.sendPostRequest(\n thumbprint,\n deviceCodeEndpoint,\n {\n body: queryString,\n headers: headers,\n proxyUrl: this.config.systemOptions.proxyUrl\n });\n\n return {\n userCode,\n deviceCode,\n verificationUri,\n expiresIn,\n interval,\n message\n };\n }\n\n /**\n * Create device code endpoint query parameters and returns string\n */\n private createQueryString(request: CommonDeviceCodeRequest): string {\n\n const parameterBuilder: RequestParameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addScopes(request.scopes);\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n if (!StringUtils.isEmpty(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * Breaks the polling with specific conditions.\n * @param request CommonDeviceCodeRequest\n * @param deviceCodeResponse DeviceCodeResponse\n */\n private continuePolling(\n deviceCodeExpirationTime: number,\n userSpecifiedTimeout?: number,\n userSpecifiedCancelFlag?: boolean,\n ): boolean {\n if (userSpecifiedCancelFlag) {\n this.logger.error(\"Token request cancelled by setting DeviceCodeRequest.cancel = true\");\n throw ClientAuthError.createDeviceCodeCancelledError();\n } else if (userSpecifiedTimeout && userSpecifiedTimeout < deviceCodeExpirationTime && TimeUtils.nowSeconds() > userSpecifiedTimeout) {\n this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${userSpecifiedTimeout}`);\n throw ClientAuthError.createUserTimeoutReachedError();\n } else if (TimeUtils.nowSeconds() > deviceCodeExpirationTime) {\n if (userSpecifiedTimeout) {\n this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${userSpecifiedTimeout}`);\n }\n this.logger.error(`Device code expired. Expiration time of device code was ${deviceCodeExpirationTime}`);\n throw ClientAuthError.createDeviceCodeExpiredError();\n }\n return true;\n }\n\n /**\n * Creates token request with device code response and polls token endpoint at interval set by the device code\n * response\n * @param request\n * @param deviceCodeResponse\n */\n private async acquireTokenWithDeviceCode(\n request: CommonDeviceCodeRequest,\n deviceCodeResponse: DeviceCodeResponse): Promise {\n\n const requestBody = this.createTokenRequestBody(request, deviceCodeResponse);\n const headers: Record = this.createTokenRequestHeaders();\n\n const userSpecifiedTimeout = request.timeout ? TimeUtils.nowSeconds() + request.timeout : undefined;\n const deviceCodeExpirationTime = TimeUtils.nowSeconds() + deviceCodeResponse.expiresIn;\n const pollingIntervalMilli = deviceCodeResponse.interval * 1000;\n\n /*\n * Poll token endpoint while (device code is not expired AND operation has not been cancelled by\n * setting CancellationToken.cancel = true). POST request is sent at interval set by pollingIntervalMilli\n */\n while (this.continuePolling(deviceCodeExpirationTime, userSpecifiedTimeout, request.cancel)) {\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: request.authority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n const response = await this.executePostToTokenEndpoint(\n this.authority.tokenEndpoint,\n requestBody,\n headers,\n thumbprint);\n\n if (response.body && response.body.error) {\n // user authorization is pending. Sleep for polling interval and try again\n if(response.body.error === Constants.AUTHORIZATION_PENDING) {\n this.logger.info(\"Authorization pending. Continue polling.\");\n await TimeUtils.delay(pollingIntervalMilli);\n } else {\n // for any other error, throw\n this.logger.info(\"Unexpected error in polling from the server\");\n throw ServerError.createPostRequestFailed(response.body.error);\n }\n } else {\n this.logger.verbose(\"Authorization completed successfully. Polling stopped.\");\n return response.body;\n }\n }\n\n /*\n * The above code should've thrown by this point, but to satisfy TypeScript,\n * and in the rare case the conditionals in continuePolling() may not catch everything...\n */\n this.logger.error(\"Polling stopped for unknown reasons.\");\n throw ClientAuthError.createDeviceCodeUnknownError();\n }\n\n /**\n * Creates query parameters and converts to string.\n * @param request\n * @param deviceCodeResponse\n */\n private createTokenRequestBody(request: CommonDeviceCodeRequest, deviceCodeResponse: DeviceCodeResponse): string {\n\n const requestParameters: RequestParameterBuilder = new RequestParameterBuilder();\n\n requestParameters.addScopes(request.scopes);\n requestParameters.addClientId(this.config.authOptions.clientId);\n requestParameters.addGrantType(GrantType.DEVICE_CODE_GRANT);\n requestParameters.addDeviceCode(deviceCodeResponse.deviceCode);\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n requestParameters.addCorrelationId(correlationId);\n requestParameters.addClientInfo();\n requestParameters.addLibraryInfo(this.config.libraryInfo);\n requestParameters.addApplicationTelemetry(this.config.telemetry.application);\n requestParameters.addThrottling();\n \n if (this.serverTelemetryManager) {\n requestParameters.addServerTelemetry(this.serverTelemetryManager);\n }\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n requestParameters.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n return requestParameters.createQueryString();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.\n *\n * @export\n * @enum {number}\n */\nexport enum PerformanceEvents {\n\n /**\n * acquireTokenByCode API (msal-browser and msal-node).\n * Used to acquire tokens by trading an authorization code against the token endpoint.\n */\n AcquireTokenByCode = \"acquireTokenByCode\",\n\n /**\n * acquireTokenByRefreshToken API (msal-browser and msal-node).\n * Used to renew an access token using a refresh token against the token endpoint.\n */\n AcquireTokenByRefreshToken = \"acquireTokenByRefreshToken\",\n\n /**\n * acquireTokenSilent API (msal-browser and msal-node).\n * Used to silently acquire a new access token (from the cache or the network).\n */\n AcquireTokenSilent = \"acquireTokenSilent\",\n\n /**\n * acquireTokenSilentAsync (msal-browser).\n * Internal API for acquireTokenSilent.\n */\n AcquireTokenSilentAsync = \"acquireTokenSilentAsync\",\n\n /**\n * acquireTokenPopup (msal-browser).\n * Used to acquire a new access token interactively through pop ups\n */\n AcquireTokenPopup = \"acquireTokenPopup\",\n\n /**\n * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).\n * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.\n */\n CryptoOptsGetPublicKeyThumbprint = \"cryptoOptsGetPublicKeyThumbprint\",\n\n /**\n * signJwt API in CryptoOpts class (msal-browser).\n * Used to signed a pop token.\n */\n CryptoOptsSignJwt = \"cryptoOptsSignJwt\",\n\n /**\n * acquireToken API in the SilentCacheClient class (msal-browser).\n * Used to read access tokens from the cache.\n */\n SilentCacheClientAcquireToken = \"silentCacheClientAcquireToken\",\n\n /**\n * acquireToken API in the SilentIframeClient class (msal-browser).\n * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.\n */\n SilentIframeClientAcquireToken = \"silentIframeClientAcquireToken\",\n\n /**\n * acquireToken API in SilentRereshClient (msal-browser).\n * Used to acquire a new set of tokens from the token endpoint using a refresh token.\n */\n SilentRefreshClientAcquireToken = \"silentRefreshClientAcquireToken\",\n\n /**\n * ssoSilent API (msal-browser).\n * Used to silently acquire an authorization code and set of tokens using a hidden iframe.\n */\n SsoSilent = \"ssoSilent\",\n\n /**\n * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).\n * Used to load authority metadata for a request.\n */\n StandardInteractionClientGetDiscoveredAuthority = \"standardInteractionClientGetDiscoveredAuthority\",\n\n /**\n * acquireToken APIs in msal-browser.\n * Used to make an /authorize endpoint call with native brokering enabled.\n */\n FetchAccountIdWithNativeBroker = \"fetchAccountIdWithNativeBroker\",\n\n /**\n * acquireToken API in NativeInteractionClient class (msal-browser).\n * Used to acquire a token from Native component when native brokering is enabled.\n */\n NativeInteractionClientAcquireToken = \"nativeInteractionClientAcquireToken\",\n /**\n * Time spent creating default headers for requests to token endpoint\n */\n BaseClientCreateTokenRequestHeaders = \"baseClientCreateTokenRequestHeaders\",\n /**\n * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).\n */\n BrokerHandhshake = \"brokerHandshake\",\n /**\n * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .\n */\n AcquireTokenByRefreshTokenInBroker = \"acquireTokenByRefreshTokenInBroker\",\n /**\n * Time taken for token acquisition by broker\n */\n AcquireTokenByBroker = \"acquireTokenByBroker\",\n\n /**\n * Time spent on the network for refresh token acquisition\n */\n RefreshTokenClientExecuteTokenRequest = \"refreshTokenClientExecuteTokenRequest\",\n\n /**\n * Time taken for acquiring refresh token , records RT size\n */\n RefreshTokenClientAcquireToken = \"refreshTokenClientAcquireToken\",\n\n /**\n * Time taken for acquiring cached refresh token \n */\n RefreshTokenClientAcquireTokenWithCachedRefreshToken = \"refreshTokenClientAcquireTokenWithCachedRefreshToken\",\n}\n\n/**\n * State of the performance event.\n *\n * @export\n * @enum {number}\n */\nexport enum PerformanceEventStatus {\n NotStarted,\n InProgress,\n Completed\n}\n\n/**\n * Performance measurement taken by the library, including metadata about the request and application.\n *\n * @export\n * @typedef {PerformanceEvent}\n */\nexport type PerformanceEvent = {\n /**\n * Unique id for the event\n *\n * @type {string}\n */\n eventId: string,\n\n /**\n * State of the perforance measure.\n *\n * @type {PerformanceEventStatus}\n */\n status: PerformanceEventStatus,\n\n /**\n * Login authority used for the request\n *\n * @type {string}\n */\n authority: string,\n\n /**\n * Client id for the application\n *\n * @type {string}\n */\n clientId: string\n\n /**\n * Correlation ID used for the request\n *\n * @type {string}\n */\n correlationId: string,\n\n /**\n * End-to-end duration in milliseconds.\n * @date 3/22/2022 - 3:40:05 PM\n *\n * @type {number}\n */\n durationMs?: number,\n\n /**\n * Visibility of the page when the event completed.\n * Read from: https://developer.mozilla.org/docs/Web/API/Page_Visibility_API\n *\n * @type {?(string | null)}\n */\n endPageVisibility?: string | null,\n\n /**\n * Whether the result was retrieved from the cache.\n *\n * @type {(boolean | null)}\n */\n fromCache?: boolean | null,\n\n /**\n * Event name (usually in the form of classNameFunctionName)\n *\n * @type {PerformanceEvents}\n */\n name: PerformanceEvents,\n\n /**\n * Visibility of the page when the event completed.\n * Read from: https://developer.mozilla.org/docs/Web/API/Page_Visibility_API\n *\n * @type {?(string | null)}\n */\n startPageVisibility?: string | null,\n\n /**\n * Unix millisecond timestamp when the event was initiated.\n *\n * @type {number}\n */\n startTimeMs: number,\n\n /**\n * Whether or the operation completed successfully.\n *\n * @type {(boolean | null)}\n */\n success?: boolean | null,\n\n /**\n * Add specific error code in case of failure\n *\n * @type {string}\n */\n errorCode?: string,\n\n /**\n * Add specific sub error code in case of failure\n *\n * @type {string}\n */\n subErrorCode?: string,\n\n /**\n * Name of the library used for the operation.\n *\n * @type {string}\n */\n libraryName: string,\n\n /**\n * Version of the library used for the operation.\n *\n * @type {string}\n */\n libraryVersion: string,\n\n /**\n * Size of the id token\n *\n * @type {number}\n */\n idTokenSize?: number,\n\n /**\n * \n * Size of the access token\n *\n * @type {number}\n */\n\n accessTokenSize?: number,\n\n /**\n * \n * Size of the refresh token\n *\n * @type {number}\n */\n\n refreshTokenSize?: number | undefined,\n\n /**\n * Application name as specified by the app.\n *\n * @type {?string}\n */\n appName?: string,\n\n /**\n * Application version as specified by the app.\n *\n * @type {?string}\n */\n appVersion?: string,\n\n /**\n * Whether the response is from a native component (e.g., WAM)\n *\n * @type {?boolean}\n */\n isNativeBroker?: boolean,\n\n /**\n * The Silent Token Cache Lookup Policy\n *\n * @type {?(number | undefined)}\n */\n cacheLookupPolicy?: number | undefined,\n\n /**\n * Request ID returned from the response\n * \n * @type {?string}\n */\n requestId?: string\n};\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { BaseClient } from \"./BaseClient\";\nimport { CommonRefreshTokenRequest } from \"../request/CommonRefreshTokenRequest\";\nimport { Authority } from \"../authority/Authority\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { GrantType, AuthenticationScheme, Errors, HeaderNames } from \"../utils/Constants\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { PopTokenGenerator } from \"../crypto/PopTokenGenerator\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { NetworkResponse } from \"../network/NetworkManager\";\nimport { CommonSilentFlowRequest } from \"../request/CommonSilentFlowRequest\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { ServerError } from \"../error/ServerError\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { UrlString } from \"../url/UrlString\";\nimport { CcsCredentialType } from \"../account/CcsCredential\";\nimport { buildClientInfoFromHomeAccountId } from \"../account/ClientInfo\";\nimport { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage } from \"../error/InteractionRequiredAuthError\";\nimport { PerformanceEvents } from \"../telemetry/performance/PerformanceEvent\";\nimport { IPerformanceClient } from \"../telemetry/performance/IPerformanceClient\";\n/**\n * OAuth2.0 refresh token client\n */\nexport class RefreshTokenClient extends BaseClient {\n constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient) {\n super(configuration, performanceClient);\n\n }\n public async acquireToken(request: CommonRefreshTokenRequest): Promise {\n const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);\n this.logger.verbose(\"RefreshTokenClientAcquireToken called\", request.correlationId);\n const reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.executeTokenRequest(request, this.authority);\n\n // Retrieve requestId from response headers\n const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n responseHandler.validateTokenResponse(response.body);\n\n return responseHandler.handleServerTokenResponse(\n response.body,\n this.authority,\n reqTimestamp,\n request,\n undefined,\n undefined,\n true,\n request.forceCache,\n requestId\n ).then((result: AuthenticationResult) => {\n atsMeasurement?.endMeasurement({\n success: true,\n refreshTokenSize: response.body.refresh_token?.length || 0\n });\n return result;\n })\n .catch((error) => {\n this.logger.verbose(\"Error in fetching refresh token\", request.correlationId);\n atsMeasurement?.endMeasurement({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false,\n refreshTokenSize: undefined\n });\n throw error;\n });\n }\n\n /**\n * Gets cached refresh token and attaches to request, then calls acquireToken API\n * @param request\n */\n public async acquireTokenByRefreshToken(request: CommonSilentFlowRequest): Promise {\n // Cannot renew token if no request object is given.\n if (!request) {\n throw ClientConfigurationError.createEmptyTokenRequestError();\n }\n\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\n if (!request.account) {\n throw ClientAuthError.createNoAccountInSilentRequestError();\n }\n\n // try checking if FOCI is enabled for the given application\n const isFOCI = this.cacheManager.isAppMetadataFOCI(request.account.environment, this.config.authOptions.clientId);\n\n // if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest\n if (isFOCI) {\n try {\n return this.acquireTokenWithCachedRefreshToken(request, true);\n } catch (e) {\n const noFamilyRTInCache = e instanceof InteractionRequiredAuthError && e.errorCode === InteractionRequiredAuthErrorMessage.noTokensFoundError.code;\n const clientMismatchErrorWithFamilyRT = e instanceof ServerError && e.errorCode === Errors.INVALID_GRANT_ERROR && e.subError === Errors.CLIENT_MISMATCH_ERROR;\n\n // if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)\n if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {\n return this.acquireTokenWithCachedRefreshToken(request, false);\n // throw in all other cases\n } else {\n throw e;\n }\n }\n }\n // fall back to application refresh token acquisition\n return this.acquireTokenWithCachedRefreshToken(request, false);\n\n }\n\n /**\n * makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached\n * @param request\n */\n private async acquireTokenWithCachedRefreshToken(request: CommonSilentFlowRequest, foci: boolean) {\n // fetches family RT or application RT based on FOCI value\n\n const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);\n this.logger.verbose(\"RefreshTokenClientAcquireTokenWithCachedRefreshToken called\", request.correlationId);\n const refreshToken = this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId, request.account, foci);\n\n if (!refreshToken) {\n atsMeasurement?.discardMeasurement();\n throw InteractionRequiredAuthError.createNoTokensFoundError();\n }\n // attach cached RT size to the current measurement\n atsMeasurement?.endMeasurement({\n success: true\n });\n\n const refreshTokenRequest: CommonRefreshTokenRequest = {\n ...request,\n refreshToken: refreshToken.secret,\n authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,\n ccsCredential: {\n credential: request.account.homeAccountId,\n type: CcsCredentialType.HOME_ACCOUNT_ID\n }\n };\n\n return this.acquireToken(refreshTokenRequest);\n }\n\n /**\n * Constructs the network message and makes a NW call to the underlying secure token service\n * @param request\n * @param authority\n */\n private async executeTokenRequest(request: CommonRefreshTokenRequest, authority: Authority)\n : Promise> {\n const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);\n const requestBody = await this.createTokenRequestBody(request);\n const queryParameters = this.createTokenQueryParameters(request);\n const headers: Record = this.createTokenRequestHeaders(request.ccsCredential);\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: authority.canonicalAuthority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParameters);\n return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)\n .then((result) => {\n acquireTokenMeasurement?.endMeasurement({\n success: true\n });\n return result;\n })\n .catch((error) => {\n acquireTokenMeasurement?.endMeasurement({\n success: false\n });\n throw error;\n });\n }\n\n /**\n * Creates query string for the /token request\n * @param request\n */\n private createTokenQueryParameters(request: CommonRefreshTokenRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n if (request.tokenQueryParameters) {\n parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * Helper function to create the token request body\n * @param request\n */\n private async createTokenRequestBody(request: CommonRefreshTokenRequest): Promise {\n const correlationId = request.correlationId;\n const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n parameterBuilder.addScopes(request.scopes);\n\n parameterBuilder.addGrantType(GrantType.REFRESH_TOKEN_GRANT);\n\n parameterBuilder.addClientInfo();\n\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n parameterBuilder.addThrottling();\n\n if (this.serverTelemetryManager) {\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\n }\n\n parameterBuilder.addCorrelationId(correlationId);\n\n parameterBuilder.addRefreshToken(request.refreshToken);\n\n if (this.config.clientCredentials.clientSecret) {\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\n }\n\n if (this.config.clientCredentials.clientAssertion) {\n const clientAssertion = this.config.clientCredentials.clientAssertion;\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\n }\n\n if (request.authenticationScheme === AuthenticationScheme.POP) {\n const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);\n const reqCnfData = await popTokenGenerator.generateCnf(request);\n // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)\n parameterBuilder.addPopToken(reqCnfData.reqCnfString);\n } else if (request.authenticationScheme === AuthenticationScheme.SSH) {\n if (request.sshJwk) {\n parameterBuilder.addSshJwk(request.sshJwk);\n } else {\n acquireTokenMeasurement?.endMeasurement({\n success: false\n });\n throw ClientConfigurationError.createMissingSshJwkError();\n }\n }\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n if (this.config.systemOptions.preventCorsPreflight && request.ccsCredential) {\n switch (request.ccsCredential.type) {\n case CcsCredentialType.HOME_ACCOUNT_ID:\n try {\n const clientInfo = buildClientInfoFromHomeAccountId(request.ccsCredential.credential);\n parameterBuilder.addCcsOid(clientInfo);\n } catch (e) {\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" + e);\n }\n break;\n case CcsCredentialType.UPN:\n parameterBuilder.addCcsUpn(request.ccsCredential.credential);\n break;\n }\n }\n acquireTokenMeasurement?.endMeasurement({\n success: true\n });\n return parameterBuilder.createQueryString();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { BaseClient } from \"./BaseClient\";\nimport { Authority } from \"../authority/Authority\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { GrantType , CredentialType, CacheOutcome, Constants, AuthenticationScheme } from \"../utils/Constants\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { CommonClientCredentialRequest } from \"../request/CommonClientCredentialRequest\";\nimport { CredentialFilter, CredentialCache } from \"../cache/utils/CacheTypes\";\nimport { AccessTokenEntity } from \"../cache/entities/AccessTokenEntity\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { IAppTokenProvider } from \"../config/AppTokenProvider\";\n\n/**\n * OAuth2.0 client credential grant\n */\nexport class ClientCredentialClient extends BaseClient {\n\n private scopeSet: ScopeSet;\n private readonly appTokenProvider?: IAppTokenProvider;\n\n constructor(configuration: ClientConfiguration, appTokenProvider?: IAppTokenProvider) {\n super(configuration);\n this.appTokenProvider = appTokenProvider;\n }\n\n /**\n * Public API to acquire a token with ClientCredential Flow for Confidential clients\n * @param request\n */\n public async acquireToken(request: CommonClientCredentialRequest): Promise {\n\n this.scopeSet = new ScopeSet(request.scopes || []);\n\n if (request.skipCache) {\n return await this.executeTokenRequest(request, this.authority);\n }\n\n const cachedAuthenticationResult = await this.getCachedAuthenticationResult(request);\n if (cachedAuthenticationResult) {\n return cachedAuthenticationResult;\n } else {\n return await this.executeTokenRequest(request, this.authority);\n }\n }\n\n /**\n * looks up cache if the tokens are cached already\n */\n private async getCachedAuthenticationResult(request: CommonClientCredentialRequest): Promise {\n \n const cachedAccessToken = this.readAccessTokenFromCache();\n\n if (!cachedAccessToken) {\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);\n return null;\n }\n\n if (TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);\n return null;\n }\n\n return await ResponseHandler.generateAuthenticationResult(\n this.cryptoUtils,\n this.authority,\n {\n account: null,\n idToken: null,\n accessToken: cachedAccessToken,\n refreshToken: null,\n appMetadata: null\n },\n true,\n request\n );\n }\n\n /**\n * Reads access token from the cache\n * TODO: Move this call to cacheManager instead\n */\n private readAccessTokenFromCache(): AccessTokenEntity | null {\n const accessTokenFilter: CredentialFilter = {\n homeAccountId: Constants.EMPTY_STRING,\n environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,\n credentialType: CredentialType.ACCESS_TOKEN,\n clientId: this.config.authOptions.clientId,\n realm: this.authority.tenant,\n target: this.scopeSet.printScopesLowerCase()\n };\n const credentialCache: CredentialCache = this.cacheManager.getCredentialsFilteredBy(accessTokenFilter);\n const accessTokens = Object.keys(credentialCache.accessTokens).map(key => credentialCache.accessTokens[key]);\n if (accessTokens.length < 1) {\n return null;\n } else if (accessTokens.length > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n return accessTokens[0] as AccessTokenEntity;\n }\n\n /**\n * Makes a network call to request the token from the service\n * @param request\n * @param authority\n */\n private async executeTokenRequest(request: CommonClientCredentialRequest, authority: Authority)\n : Promise {\n \n let serverTokenResponse: ServerAuthorizationTokenResponse;\n let reqTimestamp: number;\n\n if (this.appTokenProvider) {\n this.logger.info(\"Using appTokenProvider extensibility.\");\n\n const appTokenPropviderParameters = {\n correlationId: request.correlationId,\n tenantId: this.config.authOptions.authority.tenant,\n scopes: request.scopes,\n claims: request.claims,\n };\n\n reqTimestamp = TimeUtils.nowSeconds();\n const appTokenProviderResult = await this.appTokenProvider(appTokenPropviderParameters);\n\n serverTokenResponse = {\n access_token: appTokenProviderResult.accessToken, \n expires_in: appTokenProviderResult.expiresInSeconds,\n refresh_in: appTokenProviderResult.refreshInSeconds,\n token_type : AuthenticationScheme.BEARER\n };\n } else {\n const requestBody = this.createTokenRequestBody(request);\n const headers: Record = this.createTokenRequestHeaders();\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: request.authority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n \n reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.executePostToTokenEndpoint(authority.tokenEndpoint, requestBody, headers, thumbprint);\n serverTokenResponse = response.body;\n }\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n responseHandler.validateTokenResponse(serverTokenResponse);\n \n const tokenResponse = await responseHandler.handleServerTokenResponse(\n serverTokenResponse,\n this.authority,\n reqTimestamp,\n request\n );\n\n return tokenResponse;\n }\n\n /**\n * generate the request to the server in the acceptable format\n * @param request\n */\n private createTokenRequestBody(request: CommonClientCredentialRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n parameterBuilder.addScopes(request.scopes, false);\n\n parameterBuilder.addGrantType(GrantType.CLIENT_CREDENTIALS_GRANT);\n\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n\n parameterBuilder.addThrottling();\n \n if (this.serverTelemetryManager) {\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\n }\n\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n parameterBuilder.addCorrelationId(correlationId);\n\n if (this.config.clientCredentials.clientSecret) {\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\n }\n\n // Use clientAssertion from request, fallback to client assertion in base configuration\n const clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion;\n\n if (clientAssertion) {\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\n }\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n return parameterBuilder.createQueryString();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { BaseClient } from \"./BaseClient\";\nimport { Authority } from \"../authority/Authority\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { GrantType, AADServerParamKeys , CredentialType, Constants, CacheOutcome, AuthenticationScheme } from \"../utils/Constants\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { CommonOnBehalfOfRequest } from \"../request/CommonOnBehalfOfRequest\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { CredentialFilter, CredentialCache } from \"../cache/utils/CacheTypes\";\nimport { AccessTokenEntity } from \"../cache/entities/AccessTokenEntity\";\nimport { IdTokenEntity } from \"../cache/entities/IdTokenEntity\";\nimport { AccountEntity } from \"../cache/entities/AccountEntity\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { AccountInfo } from \"../account/AccountInfo\";\n\n/**\n * On-Behalf-Of client\n */\nexport class OnBehalfOfClient extends BaseClient {\n\n private scopeSet: ScopeSet;\n private userAssertionHash: string;\n\n constructor(configuration: ClientConfiguration) {\n super(configuration);\n }\n\n /**\n * Public API to acquire tokens with on behalf of flow\n * @param request\n */\n public async acquireToken(request: CommonOnBehalfOfRequest): Promise {\n this.scopeSet = new ScopeSet(request.scopes || []);\n\n // generate the user_assertion_hash for OBOAssertion\n this.userAssertionHash = await this.cryptoUtils.hashString(request.oboAssertion);\n\n if (request.skipCache) {\n return await this.executeTokenRequest(request, this.authority, this.userAssertionHash);\n }\n\n try {\n return await this.getCachedAuthenticationResult(request);\n } catch (e) {\n // Any failure falls back to interactive request, once we implement distributed cache, we plan to handle `createRefreshRequiredError` to refresh using the RT\n return await this.executeTokenRequest(request, this.authority, this.userAssertionHash);\n }\n }\n\n /**\n * look up cache for tokens\n * Find idtoken in the cache\n * Find accessToken based on user assertion and account info in the cache\n * Please note we are not yet supported OBO tokens refreshed with long lived RT. User will have to send a new assertion if the current access token expires\n * This is to prevent security issues when the assertion changes over time, however, longlived RT helps retaining the session\n * @param request\n */\n private async getCachedAuthenticationResult(request: CommonOnBehalfOfRequest): Promise {\n\n // look in the cache for the access_token which matches the incoming_assertion\n const cachedAccessToken = this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId, request);\n if (!cachedAccessToken) {\n // Must refresh due to non-existent access_token.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);\n this.logger.info(\"SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.\");\n throw ClientAuthError.createRefreshRequiredError();\n } else if (TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {\n // Access token expired, will need to renewed\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);\n this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`);\n throw ClientAuthError.createRefreshRequiredError();\n }\n\n // fetch the idToken from cache\n const cachedIdToken = this.readIdTokenFromCacheForOBO(request, cachedAccessToken.homeAccountId);\n let idTokenObject: AuthToken | undefined;\n let cachedAccount: AccountEntity | null = null;\n if (cachedIdToken) {\n idTokenObject = new AuthToken(cachedIdToken.secret, this.config.cryptoInterface);\n const localAccountId = idTokenObject.claims.oid ? idTokenObject.claims.oid : idTokenObject.claims.sub;\n const accountInfo: AccountInfo = {\n homeAccountId: cachedIdToken.homeAccountId,\n environment: cachedIdToken.environment,\n tenantId: cachedIdToken.realm,\n username: Constants.EMPTY_STRING,\n localAccountId: localAccountId || Constants.EMPTY_STRING\n };\n\n cachedAccount = this.cacheManager.readAccountFromCache(accountInfo);\n }\n\n // increment telemetry cache hit counter\n if (this.config.serverTelemetryManager) {\n this.config.serverTelemetryManager.incrementCacheHits();\n }\n\n return await ResponseHandler.generateAuthenticationResult(\n this.cryptoUtils,\n this.authority,\n {\n account: cachedAccount,\n accessToken: cachedAccessToken,\n idToken: cachedIdToken,\n refreshToken: null,\n appMetadata: null\n },\n true,\n request,\n idTokenObject);\n }\n\n /**\n * read idtoken from cache, this is a specific implementation for OBO as the requirements differ from a generic lookup in the cacheManager\n * Certain use cases of OBO flow do not expect an idToken in the cache/or from the service\n * @param request\n */\n private readIdTokenFromCacheForOBO(request: CommonOnBehalfOfRequest, atHomeAccountId: string): IdTokenEntity | null {\n\n const idTokenFilter: CredentialFilter = {\n homeAccountId: atHomeAccountId,\n environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,\n credentialType: CredentialType.ID_TOKEN,\n clientId: this.config.authOptions.clientId,\n realm: this.authority.tenant\n };\n\n const credentialCache: CredentialCache = this.cacheManager.getCredentialsFilteredBy(idTokenFilter);\n const idTokens = Object.keys(credentialCache.idTokens).map(key => credentialCache.idTokens[key]);\n // When acquiring a token on behalf of an application, there might not be an id token in the cache\n if (idTokens.length < 1) {\n return null;\n }\n return idTokens[0] as IdTokenEntity;\n }\n\n /**\n * Fetches the cached access token based on incoming assertion\n * @param clientId\n * @param request\n * @param userAssertionHash\n */\n private readAccessTokenFromCacheForOBO(clientId: string, request: CommonOnBehalfOfRequest) {\n const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;\n /*\n * Distinguish between Bearer and PoP/SSH token cache types\n * Cast to lowercase to handle \"bearer\" from ADFS\n */\n const credentialType = (authScheme && authScheme.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN;\n\n const accessTokenFilter: CredentialFilter = {\n credentialType: credentialType,\n clientId,\n target: this.scopeSet.printScopesLowerCase(),\n tokenType: authScheme,\n keyId: request.sshKid,\n requestedClaimsHash: request.requestedClaimsHash,\n userAssertionHash: this.userAssertionHash\n };\n\n const credentialCache: CredentialCache = this.cacheManager.getCredentialsFilteredBy(accessTokenFilter);\n\n const accessTokens = Object.keys(credentialCache.accessTokens).map((key) => credentialCache.accessTokens[key]);\n\n const numAccessTokens = accessTokens.length;\n if (numAccessTokens < 1) {\n return null;\n } else if (numAccessTokens > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n\n return accessTokens[0] as AccessTokenEntity;\n }\n\n /**\n * Make a network call to the server requesting credentials\n * @param request\n * @param authority\n */\n private async executeTokenRequest(request: CommonOnBehalfOfRequest, authority: Authority, userAssertionHash: string)\n : Promise {\n\n const requestBody = this.createTokenRequestBody(request);\n const headers: Record = this.createTokenRequestHeaders();\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: request.authority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n const reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.executePostToTokenEndpoint(authority.tokenEndpoint, requestBody, headers, thumbprint);\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n responseHandler.validateTokenResponse(response.body);\n const tokenResponse = await responseHandler.handleServerTokenResponse(\n response.body,\n this.authority,\n reqTimestamp,\n request,\n undefined,\n userAssertionHash\n );\n\n return tokenResponse;\n }\n\n /**\n * generate a server request in accepable format\n * @param request\n */\n private createTokenRequestBody(request: CommonOnBehalfOfRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n parameterBuilder.addScopes(request.scopes);\n\n parameterBuilder.addGrantType(GrantType.JWT_BEARER);\n\n parameterBuilder.addClientInfo();\n\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n parameterBuilder.addThrottling();\n\n if (this.serverTelemetryManager) {\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\n }\n\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n parameterBuilder.addCorrelationId(correlationId);\n\n parameterBuilder.addRequestTokenUse(AADServerParamKeys.ON_BEHALF_OF);\n\n parameterBuilder.addOboAssertion(request.oboAssertion);\n\n if (this.config.clientCredentials.clientSecret) {\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\n }\n\n if (this.config.clientCredentials.clientAssertion) {\n const clientAssertion = this.config.clientCredentials.clientAssertion;\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\n }\n\n return parameterBuilder.createQueryString();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BaseClient } from \"./BaseClient\";\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { CommonSilentFlowRequest } from \"../request/CommonSilentFlowRequest\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { RefreshTokenClient } from \"./RefreshTokenClient\";\nimport { ClientAuthError, ClientAuthErrorMessage } from \"../error/ClientAuthError\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { CacheRecord } from \"../cache/entities/CacheRecord\";\nimport { CacheOutcome } from \"../utils/Constants\";\nimport { IPerformanceClient } from \"../telemetry/performance/IPerformanceClient\";\n\nexport class SilentFlowClient extends BaseClient {\n \n constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient) {\n super(configuration,performanceClient);\n }\n \n /**\n * Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew\n * the given token and returns the renewed token\n * @param request\n */\n async acquireToken(request: CommonSilentFlowRequest): Promise {\n try {\n return await this.acquireCachedToken(request);\n } catch (e) {\n if (e instanceof ClientAuthError && e.errorCode === ClientAuthErrorMessage.tokenRefreshRequired.code) {\n const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);\n return refreshTokenClient.acquireTokenByRefreshToken(request);\n } else {\n throw e;\n }\n }\n }\n \n /**\n * Retrieves token from cache or throws an error if it must be refreshed.\n * @param request\n */\n async acquireCachedToken(request: CommonSilentFlowRequest): Promise {\n // Cannot renew token if no request object is given.\n if (!request) {\n throw ClientConfigurationError.createEmptyTokenRequestError();\n }\n\n if (request.forceRefresh) {\n // Must refresh due to present force_refresh flag.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.FORCE_REFRESH);\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.\");\n throw ClientAuthError.createRefreshRequiredError();\n }\n\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\n if (!request.account) {\n throw ClientAuthError.createNoAccountInSilentRequestError();\n }\n\n const environment = request.authority || this.authority.getPreferredCache();\n\n const cacheRecord = this.cacheManager.readCacheRecord(request.account, this.config.authOptions.clientId, request, environment);\n\n if (!cacheRecord.accessToken) {\n // Must refresh due to non-existent access_token.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);\n this.logger.info(\"SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.\");\n throw ClientAuthError.createRefreshRequiredError();\n } else if (\n TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||\n TimeUtils.isTokenExpired(cacheRecord.accessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)\n ) {\n // Must refresh due to expired access_token.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);\n this.logger.info(`SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`);\n throw ClientAuthError.createRefreshRequiredError();\n } else if (cacheRecord.accessToken.refreshOn && TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)) {\n // Must refresh due to the refresh_in value.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'.\");\n throw ClientAuthError.createRefreshRequiredError();\n }\n\n if (this.config.serverTelemetryManager) {\n this.config.serverTelemetryManager.incrementCacheHits();\n }\n\n return await this.generateResultFromCacheRecord(cacheRecord, request);\n }\n\n /**\n * Helper function to build response object from the CacheRecord\n * @param cacheRecord\n */\n private async generateResultFromCacheRecord(cacheRecord: CacheRecord, request: CommonSilentFlowRequest): Promise {\n let idTokenObj: AuthToken | undefined;\n if (cacheRecord.idToken) {\n idTokenObj = new AuthToken(cacheRecord.idToken.secret, this.config.cryptoInterface);\n }\n\n // token max_age check\n if (request.maxAge || (request.maxAge === 0)) {\n const authTime = idTokenObj?.claims.auth_time;\n if (!authTime) {\n throw ClientAuthError.createAuthTimeNotFoundError();\n }\n\n AuthToken.checkMaxAge(authTime, request.maxAge);\n }\n\n return await ResponseHandler.generateAuthenticationResult(\n this.cryptoUtils,\n this.authority,\n cacheRecord,\n true,\n request,\n idTokenObj\n );\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BaseClient } from \"./BaseClient\";\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { CommonUsernamePasswordRequest } from \"../request/CommonUsernamePasswordRequest\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { Authority } from \"../authority/Authority\";\nimport { NetworkResponse } from \"../network/NetworkManager\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { GrantType } from \"../utils/Constants\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { CcsCredentialType } from \"../account/CcsCredential\";\n\n/**\n * Oauth2.0 Password grant client\n * Note: We are only supporting public clients for password grant and for purely testing purposes\n */\nexport class UsernamePasswordClient extends BaseClient {\n\n constructor(configuration: ClientConfiguration) {\n super(configuration);\n }\n\n /**\n * API to acquire a token by passing the username and password to the service in exchage of credentials\n * password_grant\n * @param request\n */\n async acquireToken(request: CommonUsernamePasswordRequest): Promise {\n this.logger.info(\"in acquireToken call\");\n\n const reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.executeTokenRequest(this.authority, request);\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n // Validate response. This function throws a server error if an error is returned by the server.\n responseHandler.validateTokenResponse(response.body);\n const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);\n\n return tokenResponse;\n }\n\n /**\n * Executes POST request to token endpoint\n * @param authority\n * @param request\n */\n private async executeTokenRequest(authority: Authority, request: CommonUsernamePasswordRequest): Promise> {\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: authority.canonicalAuthority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n const requestBody = this.createTokenRequestBody(request);\n const headers: Record = this.createTokenRequestHeaders({\n credential: request.username,\n type: CcsCredentialType.UPN\n });\n\n return this.executePostToTokenEndpoint(authority.tokenEndpoint, requestBody, headers, thumbprint);\n }\n\n /**\n * Generates a map for all the params to be sent to the service\n * @param request\n */\n private createTokenRequestBody(request: CommonUsernamePasswordRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n parameterBuilder.addUsername(request.username);\n parameterBuilder.addPassword(request.password);\n\n parameterBuilder.addScopes(request.scopes);\n\n parameterBuilder.addResponseTypeForTokenAndIdToken();\n\n parameterBuilder.addGrantType(GrantType.RESOURCE_OWNER_PASSWORD_GRANT);\n parameterBuilder.addClientInfo();\n\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n parameterBuilder.addThrottling();\n\n if (this.serverTelemetryManager) {\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\n }\n\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n parameterBuilder.addCorrelationId(correlationId);\n\n if (this.config.clientCredentials.clientSecret) {\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\n }\n\n if (this.config.clientCredentials.clientAssertion) {\n const clientAssertion = this.config.clientCredentials.clientAssertion;\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\n }\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n if (this.config.systemOptions.preventCorsPreflight && request.username) {\n parameterBuilder.addCcsUpn(request.username);\n }\n\n return parameterBuilder.createQueryString();\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Tenant Discovery Response which contains the relevant OAuth endpoints and data needed for authentication and authorization.\n */\nexport type OpenIdConfigResponse = {\n authorization_endpoint: string;\n token_endpoint: string;\n end_session_endpoint?: string;\n issuer: string;\n jwks_uri: string;\n};\n\nexport function isOpenIdConfigResponse(response: object): boolean {\n return (\n response.hasOwnProperty(\"authorization_endpoint\") &&\n response.hasOwnProperty(\"token_endpoint\") && \n response.hasOwnProperty(\"issuer\") &&\n response.hasOwnProperty(\"jwks_uri\")\n );\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport const 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\"]}]}}};\n\nexport const EndpointMetadata = rawMetdataJSON.endpointMetadata;\nexport const InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;\n\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Protocol modes supported by MSAL.\n */\nexport enum ProtocolMode {\n AAD = \"AAD\",\n OIDC = \"OIDC\"\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CloudDiscoveryMetadata } from \"../../authority/CloudDiscoveryMetadata\";\nimport { OpenIdConfigResponse } from \"../../authority/OpenIdConfigResponse\";\nimport { AUTHORITY_METADATA_CONSTANTS } from \"../../utils/Constants\";\nimport { TimeUtils } from \"../../utils/TimeUtils\";\n\nexport class AuthorityMetadataEntity {\n aliases: Array;\n preferred_cache: string;\n preferred_network: string;\n canonical_authority: string;\n authorization_endpoint: string;\n token_endpoint: string;\n end_session_endpoint?: string;\n issuer: string;\n aliasesFromNetwork: boolean;\n endpointsFromNetwork: boolean;\n expiresAt: number;\n jwks_uri: string;\n\n constructor() {\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\n }\n\n /**\n * Update the entity with new aliases, preferred_cache and preferred_network values\n * @param metadata \n * @param fromNetwork \n */\n updateCloudDiscoveryMetadata(metadata: CloudDiscoveryMetadata, fromNetwork: boolean): void {\n this.aliases = metadata.aliases;\n this.preferred_cache = metadata.preferred_cache;\n this.preferred_network = metadata.preferred_network;\n this.aliasesFromNetwork = fromNetwork;\n }\n\n /**\n * Update the entity with new endpoints\n * @param metadata \n * @param fromNetwork \n */\n updateEndpointMetadata(metadata: OpenIdConfigResponse, fromNetwork: boolean): void {\n this.authorization_endpoint = metadata.authorization_endpoint;\n this.token_endpoint = metadata.token_endpoint;\n this.end_session_endpoint = metadata.end_session_endpoint;\n this.issuer = metadata.issuer;\n this.endpointsFromNetwork = fromNetwork;\n this.jwks_uri = metadata.jwks_uri;\n }\n\n /**\n * Save the authority that was used to create this cache entry\n * @param authority \n */\n updateCanonicalAuthority(authority: string): void {\n this.canonical_authority = authority;\n }\n\n /**\n * Reset the exiresAt value\n */\n resetExpiresAt(): void {\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\n }\n\n /**\n * Returns whether or not the data needs to be refreshed\n */\n isExpired(): boolean {\n return this.expiresAt <= TimeUtils.nowSeconds();\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAuthorityMetadataEntity(key: string, entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&\n entity.hasOwnProperty(\"aliases\") &&\n entity.hasOwnProperty(\"preferred_cache\") &&\n entity.hasOwnProperty(\"preferred_network\") &&\n entity.hasOwnProperty(\"canonical_authority\") &&\n entity.hasOwnProperty(\"authorization_endpoint\") &&\n entity.hasOwnProperty(\"token_endpoint\") &&\n entity.hasOwnProperty(\"issuer\") &&\n entity.hasOwnProperty(\"aliasesFromNetwork\") &&\n entity.hasOwnProperty(\"endpointsFromNetwork\") &&\n entity.hasOwnProperty(\"expiresAt\") &&\n entity.hasOwnProperty(\"jwks_uri\")\n );\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CloudDiscoveryMetadata } from \"./CloudDiscoveryMetadata\";\n\n/**\n * The OpenID Configuration Endpoint Response type. Used by the authority class to get relevant OAuth endpoints.\n */\nexport type CloudInstanceDiscoveryResponse = {\n tenant_discovery_endpoint: string;\n metadata: Array;\n};\n\nexport function isCloudInstanceDiscoveryResponse(response: object): boolean {\n return (\n response.hasOwnProperty(\"tenant_discovery_endpoint\") &&\n response.hasOwnProperty(\"metadata\")\n );\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { NetworkResponse } from \"../network/NetworkManager\";\nimport { IMDSBadResponse } from \"../response/IMDSBadResponse\";\nimport { Constants, RegionDiscoverySources, ResponseCodes } from \"../utils/Constants\";\nimport { RegionDiscoveryMetadata } from \"./RegionDiscoveryMetadata\";\nimport { ImdsOptions } from \"./ImdsOptions\";\n\nexport class RegionDiscovery {\n // Network interface to make requests with.\n protected networkInterface: INetworkModule;\n // Options for the IMDS endpoint request\n protected static IMDS_OPTIONS: ImdsOptions = {\n headers: {\n Metadata: \"true\",\n },\n };\n\n constructor(networkInterface: INetworkModule) {\n this.networkInterface = networkInterface;\n }\n\n /**\n * Detect the region from the application's environment.\n * \n * @returns Promise\n */\n public async detectRegion(environmentRegion: string | undefined, regionDiscoveryMetadata: RegionDiscoveryMetadata, proxyUrl: string): Promise {\n // Initialize auto detected region with the region from the envrionment \n let autodetectedRegionName = environmentRegion;\n\n // Check if a region was detected from the environment, if not, attempt to get the region from IMDS \n if (!autodetectedRegionName) {\n const options = RegionDiscovery.IMDS_OPTIONS;\n if (proxyUrl) {\n options.proxyUrl = proxyUrl;\n }\n\n try {\n const localIMDSVersionResponse = await this.getRegionFromIMDS(Constants.IMDS_VERSION, options);\n if (localIMDSVersionResponse.status === ResponseCodes.httpSuccess) {\n autodetectedRegionName = localIMDSVersionResponse.body;\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.IMDS;\n } \n \n // If the response using the local IMDS version failed, try to fetch the current version of IMDS and retry. \n if (localIMDSVersionResponse.status === ResponseCodes.httpBadRequest) {\n const currentIMDSVersion = await this.getCurrentVersion(options);\n if (!currentIMDSVersion) {\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;\n return null;\n }\n\n const currentIMDSVersionResponse = await this.getRegionFromIMDS(currentIMDSVersion, options);\n if (currentIMDSVersionResponse.status === ResponseCodes.httpSuccess) {\n autodetectedRegionName = currentIMDSVersionResponse.body;\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.IMDS;\n }\n }\n } catch(e) {\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;\n return null;\n } \n } else {\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.ENVIRONMENT_VARIABLE;\n }\n\n // If no region was auto detected from the environment or from the IMDS endpoint, mark the attempt as a FAILED_AUTO_DETECTION\n if (!autodetectedRegionName) {\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;\n }\n\n return autodetectedRegionName || null;\n }\n\n /**\n * Make the call to the IMDS endpoint\n * \n * @param imdsEndpointUrl\n * @returns Promise>\n */\n private async getRegionFromIMDS(version: string, options: ImdsOptions): Promise> {\n return this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?api-version=${version}&format=text`, options, Constants.IMDS_TIMEOUT);\n }\n\n /**\n * Get the most recent version of the IMDS endpoint available\n * \n * @returns Promise\n */\n private async getCurrentVersion(options: ImdsOptions): Promise {\n try {\n const response = await this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?format=json`, options);\n\n // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.\n if (response.status === ResponseCodes.httpBadRequest && response.body && response.body[\"newest-versions\"] && response.body[\"newest-versions\"].length > 0) {\n return response.body[\"newest-versions\"][0];\n }\n\n return null;\n } catch (e) {\n return null;\n }\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorityType } from \"./AuthorityType\";\nimport { isOpenIdConfigResponse, OpenIdConfigResponse } from \"./OpenIdConfigResponse\";\nimport { UrlString } from \"../url/UrlString\";\nimport { IUri } from \"../url/IUri\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { AuthorityMetadataSource, Constants, RegionDiscoveryOutcomes } from \"../utils/Constants\";\nimport { EndpointMetadata, InstanceDiscoveryMetadata } from \"./AuthorityMetadata\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ProtocolMode } from \"./ProtocolMode\";\nimport { ICacheManager } from \"../cache/interface/ICacheManager\";\nimport { AuthorityMetadataEntity } from \"../cache/entities/AuthorityMetadataEntity\";\nimport { AuthorityOptions , AzureCloudInstance } from \"./AuthorityOptions\";\nimport { CloudInstanceDiscoveryResponse, isCloudInstanceDiscoveryResponse } from \"./CloudInstanceDiscoveryResponse\";\nimport { CloudDiscoveryMetadata } from \"./CloudDiscoveryMetadata\";\nimport { RegionDiscovery } from \"./RegionDiscovery\";\nimport { RegionDiscoveryMetadata } from \"./RegionDiscoveryMetadata\";\nimport { ImdsOptions } from \"./ImdsOptions\";\nimport { AzureCloudOptions } from \"../config/ClientConfiguration\";\n\n/**\n * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the\n * endpoint. It will store the pertinent config data in this object for use during token calls.\n */\nexport class Authority {\n\n // Canonical authority url string\n private _canonicalAuthority: UrlString;\n // Canonicaly authority url components\n private _canonicalAuthorityUrlComponents: IUri | null;\n // Network interface to make requests with.\n protected networkInterface: INetworkModule;\n // Cache Manager to cache network responses\n protected cacheManager: ICacheManager;\n // Protocol mode to construct endpoints\n private authorityOptions: AuthorityOptions;\n // Authority metadata\n private metadata: AuthorityMetadataEntity;\n // Region discovery service\n private regionDiscovery: RegionDiscovery;\n // Region discovery metadata\n public regionDiscoveryMetadata: RegionDiscoveryMetadata;\n // Proxy url string\n private proxyUrl: string;\n\n constructor(\n authority: string,\n networkInterface: INetworkModule,\n cacheManager: ICacheManager,\n authorityOptions: AuthorityOptions,\n proxyUrl?: string) {\n this.canonicalAuthority = authority;\n this._canonicalAuthority.validateAsUri();\n this.networkInterface = networkInterface;\n this.cacheManager = cacheManager;\n this.authorityOptions = authorityOptions;\n this.regionDiscovery = new RegionDiscovery(networkInterface);\n this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };\n this.proxyUrl = proxyUrl || Constants.EMPTY_STRING;\n }\n\n // See above for AuthorityType\n public get authorityType(): AuthorityType {\n const pathSegments = this.canonicalAuthorityUrlComponents.PathSegments;\n if (pathSegments.length) {\n switch(pathSegments[0].toLowerCase()) {\n case Constants.ADFS:\n return AuthorityType.Adfs;\n case Constants.DSTS:\n return AuthorityType.Dsts;\n default:\n break;\n }\n }\n return AuthorityType.Default;\n }\n\n /**\n * ProtocolMode enum representing the way endpoints are constructed.\n */\n public get protocolMode(): ProtocolMode {\n return this.authorityOptions.protocolMode;\n }\n\n /**\n * Returns authorityOptions which can be used to reinstantiate a new authority instance\n */\n public get options(): AuthorityOptions {\n return this.authorityOptions;\n }\n\n /**\n * A URL that is the authority set by the developer\n */\n public get canonicalAuthority(): string {\n return this._canonicalAuthority.urlString;\n }\n\n /**\n * Sets canonical authority.\n */\n public set canonicalAuthority(url: string) {\n this._canonicalAuthority = new UrlString(url);\n this._canonicalAuthority.validateAsUri();\n this._canonicalAuthorityUrlComponents = null;\n }\n\n /**\n * Get authority components.\n */\n public get canonicalAuthorityUrlComponents(): IUri {\n if (!this._canonicalAuthorityUrlComponents) {\n this._canonicalAuthorityUrlComponents = this._canonicalAuthority.getUrlComponents();\n }\n\n return this._canonicalAuthorityUrlComponents;\n }\n\n /**\n * Get hostname and port i.e. login.microsoftonline.com\n */\n public get hostnameAndPort(): string {\n return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase();\n }\n\n /**\n * Get tenant for authority.\n */\n public get tenant(): string {\n return this.canonicalAuthorityUrlComponents.PathSegments[0];\n }\n\n /**\n * OAuth /authorize endpoint for requests\n */\n public get authorizationEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.authorization_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth /token endpoint for requests\n */\n public get tokenEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.token_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n public get deviceCodeEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.token_endpoint.replace(\"/token\", \"/devicecode\"));\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth logout endpoint for requests\n */\n public get endSessionEndpoint(): string {\n if(this.discoveryComplete()) {\n // ROPC policies may not have end_session_endpoint set\n if (!this.metadata.end_session_endpoint) {\n throw ClientAuthError.createLogoutNotSupportedError();\n }\n const endpoint = this.replacePath(this.metadata.end_session_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth issuer for requests\n */\n public get selfSignedJwtAudience(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.issuer);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * Jwks_uri for token signing keys\n */\n public get jwksUri(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.jwks_uri);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * Replaces tenant in url path with current tenant. Defaults to common.\n * @param urlString\n */\n private replaceTenant(urlString: string): string {\n return urlString.replace(/{tenant}|{tenantid}/g, this.tenant);\n }\n\n /**\n * Replaces path such as tenant or policy with the current tenant or policy.\n * @param urlString\n */\n private replacePath(urlString: string): string {\n let endpoint = urlString;\n const cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);\n const cachedAuthorityParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\n const currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;\n\n currentAuthorityParts.forEach((currentPart, index) => {\n const cachedPart = cachedAuthorityParts[index];\n if (currentPart !== cachedPart) {\n endpoint = endpoint.replace(`/${cachedPart}/`, `/${currentPart}/`);\n }\n });\n\n return endpoint;\n }\n\n /**\n * The default open id configuration endpoint for any canonical authority.\n */\n protected get defaultOpenIdConfigurationEndpoint(): string {\n if (\n this.authorityType === AuthorityType.Adfs ||\n this.authorityType === AuthorityType.Dsts ||\n this.protocolMode === ProtocolMode.OIDC\n ) {\n return `${this.canonicalAuthority}.well-known/openid-configuration`;\n }\n return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;\n }\n\n /**\n * Boolean that returns whethr or not tenant discovery has been completed.\n */\n discoveryComplete(): boolean {\n return !!this.metadata;\n }\n\n /**\n * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network\n * and the /authorize, /token and logout endpoints.\n */\n public async resolveEndpointsAsync(): Promise {\n let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);\n if (!metadataEntity) {\n metadataEntity = new AuthorityMetadataEntity();\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\n }\n\n const cloudDiscoverySource = await this.updateCloudDiscoveryMetadata(metadataEntity);\n this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);\n const endpointSource = await this.updateEndpointMetadata(metadataEntity);\n\n if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE && endpointSource !== AuthorityMetadataSource.CACHE) {\n // Reset the expiration time unless both values came from a successful cache lookup\n metadataEntity.resetExpiresAt();\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\n }\n\n const cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache);\n this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);\n this.metadata = metadataEntity;\n }\n\n /**\n * Update AuthorityMetadataEntity with new endpoints and return where the information came from\n * @param metadataEntity\n */\n private async updateEndpointMetadata(metadataEntity: AuthorityMetadataEntity): Promise {\n let metadata = this.getEndpointMetadataFromConfig();\n if (metadata) {\n metadataEntity.updateEndpointMetadata(metadata, false);\n return AuthorityMetadataSource.CONFIG;\n }\n\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.endpointsFromNetwork && !metadataEntity.isExpired()) {\n // No need to update\n return AuthorityMetadataSource.CACHE;\n }\n\n let harcodedMetadata = this.getEndpointMetadataFromHardcodedValues();\n metadata = await this.getEndpointMetadataFromNetwork();\n if (metadata) {\n // If the user prefers to use an azure region replace the global endpoints with regional information.\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\n metadata = await this.updateMetadataWithRegionalInformation(metadata);\n }\n\n metadataEntity.updateEndpointMetadata(metadata, true);\n return AuthorityMetadataSource.NETWORK;\n } \n\n if (harcodedMetadata && !this.authorityOptions.skipAuthorityMetadataCache) {\n // If the user prefers to use an azure region replace the global endpoints with regional information.\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\n harcodedMetadata = await this.updateMetadataWithRegionalInformation(\n harcodedMetadata\n );\n }\n\n metadataEntity.updateEndpointMetadata(harcodedMetadata, false);\n return AuthorityMetadataSource.HARDCODED_VALUES;\n } else {\n throw ClientAuthError.createUnableToGetOpenidConfigError(\n this.defaultOpenIdConfigurationEndpoint\n );\n }\n }\n\n /**\n * Compares the number of url components after the domain to determine if the cached \n * authority metadata can be used for the requested authority. Protects against same domain different \n * authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy\n * @param metadataEntity\n */\n private isAuthoritySameType(metadataEntity: AuthorityMetadataEntity): boolean {\n const cachedAuthorityUrl = new UrlString(metadataEntity.canonical_authority);\n const cachedParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\n\n return cachedParts.length === this.canonicalAuthorityUrlComponents.PathSegments.length;\n }\n\n /**\n * Parse authorityMetadata config option\n */\n private getEndpointMetadataFromConfig(): OpenIdConfigResponse | null {\n if (this.authorityOptions.authorityMetadata) {\n try {\n return JSON.parse(this.authorityOptions.authorityMetadata) as OpenIdConfigResponse;\n } catch (e) {\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\n }\n }\n\n return null;\n }\n\n /**\n * Gets OAuth endpoints from the given OpenID configuration endpoint.\n * \n * @param hasHardcodedMetadata boolean\n */\n private async getEndpointMetadataFromNetwork(): Promise {\n const options: ImdsOptions = {};\n if (this.proxyUrl) {\n options.proxyUrl = this.proxyUrl;\n }\n\n /*\n * TODO: Add a timeout if the authority exists in our library's \n * hardcoded list of metadata\n */\n\n try {\n const response = await this.networkInterface.\n sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options);\n return isOpenIdConfigResponse(response.body) ? response.body : null;\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Get OAuth endpoints for common authorities.\n */\n private getEndpointMetadataFromHardcodedValues(): OpenIdConfigResponse | null {\n if (this.canonicalAuthority in EndpointMetadata) {\n return EndpointMetadata[this.canonicalAuthority];\n }\n\n return null;\n }\n\n /**\n * Update the retrieved metadata with regional information.\n */\n private async updateMetadataWithRegionalInformation(metadata: OpenIdConfigResponse): Promise {\n const autodetectedRegionName = await this.regionDiscovery.detectRegion(\n this.authorityOptions.azureRegionConfiguration?.environmentRegion,\n this.regionDiscoveryMetadata,\n this.proxyUrl\n );\n\n const azureRegion = \n this.authorityOptions.azureRegionConfiguration?.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG\n ? autodetectedRegionName\n : this.authorityOptions.azureRegionConfiguration?.azureRegion;\n\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {\n this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;\n } else {\n if (autodetectedRegionName) {\n this.regionDiscoveryMetadata.region_outcome = (\n this.authorityOptions.azureRegionConfiguration?.azureRegion === autodetectedRegionName\n ) ?\n RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :\n RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;\n } else {\n this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;\n }\n }\n\n if (azureRegion) {\n this.regionDiscoveryMetadata.region_used = azureRegion;\n return Authority.replaceWithRegionalInformation(metadata, azureRegion);\n }\n\n return metadata;\n }\n\n /**\n * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache\n * and returns where the information was retrieved from\n * @param cachedMetadata\n * @param newMetadata\n */\n private async updateCloudDiscoveryMetadata(metadataEntity: AuthorityMetadataEntity): Promise {\n let metadata = this.getCloudDiscoveryMetadataFromConfig();\n if (metadata) {\n metadataEntity.updateCloudDiscoveryMetadata(metadata, false);\n return AuthorityMetadataSource.CONFIG;\n }\n\n // If The cached metadata came from config but that config was not passed to this instance, we must go to the network\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.aliasesFromNetwork && !metadataEntity.isExpired()) {\n // No need to update\n return AuthorityMetadataSource.CACHE;\n }\n\n const harcodedMetadata = this.getCloudDiscoveryMetadataFromHarcodedValues();\n\n metadata = await this.getCloudDiscoveryMetadataFromNetwork();\n if (metadata) {\n metadataEntity.updateCloudDiscoveryMetadata(metadata, true);\n return AuthorityMetadataSource.NETWORK;\n }\n \n if (harcodedMetadata && !this.options.skipAuthorityMetadataCache) {\n metadataEntity.updateCloudDiscoveryMetadata(harcodedMetadata, false);\n return AuthorityMetadataSource.HARDCODED_VALUES;\n } else {\n // Metadata could not be obtained from config, cache or network\n throw ClientConfigurationError.createUntrustedAuthorityError();\n }\n }\n\n /**\n * Parse cloudDiscoveryMetadata config or check knownAuthorities\n */\n private getCloudDiscoveryMetadataFromConfig(): CloudDiscoveryMetadata | null {\n // Check if network response was provided in config\n if (this.authorityOptions.cloudDiscoveryMetadata) {\n try {\n const parsedResponse = JSON.parse(this.authorityOptions.cloudDiscoveryMetadata) as CloudInstanceDiscoveryResponse;\n const metadata = Authority.getCloudDiscoveryMetadataFromNetworkResponse(\n parsedResponse.metadata,\n this.hostnameAndPort\n );\n if (metadata) {\n return metadata;\n }\n } catch (e) {\n throw ClientConfigurationError.createInvalidCloudDiscoveryMetadataError();\n }\n }\n // If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities\n if (this.isInKnownAuthorities()) {\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\n }\n\n return null;\n }\n\n /**\n * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config\n * \n * @param hasHardcodedMetadata boolean\n */\n private async getCloudDiscoveryMetadataFromNetwork(): Promise {\n const instanceDiscoveryEndpoint =\n `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;\n const options: ImdsOptions = {};\n if (this.proxyUrl) {\n options.proxyUrl = this.proxyUrl;\n }\n\n /*\n * TODO: Add a timeout if the authority exists in our library's\n * hardcoded list of metadata\n */\n\n let match = null;\n try {\n const response =\n await this.networkInterface.sendGetRequestAsync(\n instanceDiscoveryEndpoint,\n options\n );\n const metadata = isCloudInstanceDiscoveryResponse(response.body)\n ? response.body.metadata\n : [];\n if (metadata.length === 0) {\n // If no metadata is returned, authority is untrusted\n return null;\n }\n match = Authority.getCloudDiscoveryMetadataFromNetworkResponse(\n metadata,\n this.hostnameAndPort\n );\n } catch (e) {\n return null;\n }\n\n if (!match) {\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded\n match = Authority.createCloudDiscoveryMetadataFromHost(\n this.hostnameAndPort\n );\n }\n return match;\n }\n\n /**\n * Get cloud discovery metadata for common authorities \n */\n private getCloudDiscoveryMetadataFromHarcodedValues(): CloudDiscoveryMetadata | null {\n if (this.canonicalAuthority in InstanceDiscoveryMetadata) {\n return InstanceDiscoveryMetadata[this.canonicalAuthority];\n }\n\n return null;\n }\n\n /**\n * Helper function to determine if this host is included in the knownAuthorities config option\n */\n private isInKnownAuthorities(): boolean {\n const matches = this.authorityOptions.knownAuthorities.filter((authority) => {\n return UrlString.getDomainFromUrl(authority).toLowerCase() === this.hostnameAndPort;\n });\n\n return matches.length > 0;\n }\n\n /**\n * helper function to populate the authority based on azureCloudOptions\n * @param authorityString\n * @param azureCloudOptions\n */\n static generateAuthority(authorityString: string, azureCloudOptions?: AzureCloudOptions): string {\n let authorityAzureCloudInstance;\n\n if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {\n const tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;\n authorityAzureCloudInstance = `${azureCloudOptions.azureCloudInstance}/${tenant}/`;\n }\n\n return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;\n }\n\n /**\n * Creates cloud discovery metadata object from a given host\n * @param host\n */\n static createCloudDiscoveryMetadataFromHost(host: string): CloudDiscoveryMetadata {\n return {\n preferred_network: host,\n preferred_cache: host,\n aliases: [host]\n };\n }\n\n /**\n * Searches instance discovery network response for the entry that contains the host in the aliases list\n * @param response\n * @param authority\n */\n static getCloudDiscoveryMetadataFromNetworkResponse(\n response: CloudDiscoveryMetadata[],\n authority: string\n ): CloudDiscoveryMetadata | null {\n for (let i = 0; i < response.length; i++) {\n const metadata = response[i];\n if (metadata.aliases.indexOf(authority) > -1) {\n return metadata;\n }\n }\n\n return null;\n }\n\n /**\n * helper function to generate environment from authority object\n */\n getPreferredCache(): string {\n if(this.discoveryComplete()) {\n return this.metadata.preferred_cache;\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * Returns whether or not the provided host is an alias of this authority instance\n * @param host\n */\n isAlias(host: string): boolean {\n return this.metadata.aliases.indexOf(host) > -1;\n }\n\n /**\n * Checks whether the provided host is that of a public cloud authority\n *\n * @param authority string\n * @returns bool\n */\n static isPublicCloudAuthority(host: string): boolean {\n return Constants.KNOWN_PUBLIC_CLOUDS.indexOf(host) >= 0;\n }\n\n /**\n * Rebuild the authority string with the region\n *\n * @param host string\n * @param region string\n */\n static buildRegionalAuthorityString(host: string, region: string, queryString?: string): string {\n // Create and validate a Url string object with the initial authority string\n const authorityUrlInstance = new UrlString(host);\n authorityUrlInstance.validateAsUri();\n\n const authorityUrlParts = authorityUrlInstance.getUrlComponents();\n\n let hostNameAndPort= `${region}.${authorityUrlParts.HostNameAndPort}`;\n\n if (this.isPublicCloudAuthority(authorityUrlParts.HostNameAndPort)) {\n hostNameAndPort = `${region}.${Constants.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`;\n }\n\n // Include the query string portion of the url\n const url = UrlString.constructAuthorityUriFromObject({\n ...authorityUrlInstance.getUrlComponents(),\n HostNameAndPort: hostNameAndPort\n }).urlString;\n\n // Add the query string if a query string was provided\n if (queryString) return `${url}?${queryString}`;\n\n return url;\n }\n\n /**\n * Replace the endpoints in the metadata object with their regional equivalents.\n *\n * @param metadata OpenIdConfigResponse\n * @param azureRegion string\n */\n static replaceWithRegionalInformation(metadata: OpenIdConfigResponse, azureRegion: string): OpenIdConfigResponse {\n metadata.authorization_endpoint = Authority.buildRegionalAuthorityString(metadata.authorization_endpoint, azureRegion);\n // TODO: Enquire on whether we should leave the query string or remove it before releasing the feature\n metadata.token_endpoint = Authority.buildRegionalAuthorityString(\n metadata.token_endpoint, azureRegion, Constants.REGIONAL_AUTH_NON_MSI_QUERY_STRING\n );\n\n if (metadata.end_session_endpoint) {\n metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_endpoint, azureRegion);\n }\n\n return metadata;\n }\n}\n\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Authority } from \"./Authority\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { ICacheManager } from \"../cache/interface/ICacheManager\";\nimport { AuthorityOptions } from \"./AuthorityOptions\";\n\nexport class AuthorityFactory {\n\n /**\n * Create an authority object of the correct type based on the url\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\n *\n * Also performs endpoint discovery.\n *\n * @param authorityUri\n * @param networkClient\n * @param protocolMode\n */\n static async createDiscoveredInstance(\n authorityUri: string,\n networkClient: INetworkModule,\n cacheManager: ICacheManager,\n authorityOptions: AuthorityOptions,\n proxyUrl?: string\n ): Promise {\n // Initialize authority and perform discovery endpoint check.\n const acquireTokenAuthority: Authority = AuthorityFactory.createInstance(\n authorityUri,\n networkClient,\n cacheManager,\n authorityOptions,\n proxyUrl\n );\n\n try {\n await acquireTokenAuthority.resolveEndpointsAsync();\n return acquireTokenAuthority;\n } catch (e) {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(e);\n }\n }\n\n /**\n * Create an authority object of the correct type based on the url\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\n *\n * Does not perform endpoint discovery.\n *\n * @param authorityUrl\n * @param networkInterface\n * @param protocolMode\n */\n static createInstance(\n authorityUrl: string,\n networkInterface: INetworkModule,\n cacheManager: ICacheManager,\n authorityOptions: AuthorityOptions,\n proxyUrl?: string\n ): Authority {\n // Throw error if authority url is empty\n if (StringUtils.isEmpty(authorityUrl)) {\n throw ClientConfigurationError.createUrlEmptyError();\n }\n\n return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions, proxyUrl);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SERVER_TELEM_CONSTANTS } from \"../../utils/Constants\";\n\nexport class ServerTelemetryEntity {\n failedRequests: Array;\n errors: string[];\n cacheHits: number;\n\n constructor() {\n this.failedRequests = [];\n this.errors = [];\n this.cacheHits = 0;\n }\n\n /**\n * validates if a given cache entry is \"Telemetry\", parses \n * @param key\n * @param entity\n */\n static isServerTelemetryEntity(key: string, entity?: object): boolean {\n\n const validateKey: boolean = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\n let validateEntity: boolean = true;\n\n if (entity) {\n validateEntity =\n entity.hasOwnProperty(\"failedRequests\") &&\n entity.hasOwnProperty(\"errors\") &&\n entity.hasOwnProperty(\"cacheHits\");\n }\n\n return validateKey && validateEntity;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ThrottlingConstants } from \"../../utils/Constants\";\n\nexport class ThrottlingEntity {\n // Unix-time value representing the expiration of the throttle\n throttleTime: number;\n // Information provided by the server\n error?: string;\n errorCodes?: Array;\n errorMessage?: string;\n subError?: string;\n\n /**\n * validates if a given cache entry is \"Throttling\", parses \n * @param key\n * @param entity\n */\n static isThrottlingEntity(key: string, entity?: object): boolean {\n \n let validateKey: boolean = false;\n if (key) {\n validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;\n }\n \n let validateEntity: boolean = true;\n if (entity) {\n validateEntity = entity.hasOwnProperty(\"throttleTime\");\n }\n\n return validateKey && validateEntity;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"../error/AuthError\";\nimport { NetworkResponse } from \"./NetworkManager\";\n\n/**\n * Options allowed by network request APIs.\n */\nexport type NetworkRequestOptions = {\n headers?: Record,\n body?: string;\n proxyUrl?: string;\n};\n\n/**\n * Client network interface to send backend requests.\n * @interface\n */\nexport interface INetworkModule {\n\n /**\n * Interface function for async network \"GET\" requests. Based on the Fetch standard: https://fetch.spec.whatwg.org/\n * @param url\n * @param requestParams\n * @param enableCaching\n */\n sendGetRequestAsync(url: string, options?: NetworkRequestOptions, cancellationToken?: number): Promise>;\n\n /**\n * Interface function for async network \"POST\" requests. Based on the Fetch standard: https://fetch.spec.whatwg.org/\n * @param url\n * @param requestParams\n * @param enableCaching\n */\n sendPostRequestAsync(url: string, options?: NetworkRequestOptions): Promise>;\n}\n\nexport const StubbedNetworkModule: INetworkModule = {\n sendGetRequestAsync: () => {\n const notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented for the Network interface.\";\n return Promise.reject(AuthError.createUnexpectedError(notImplErr));\n },\n sendPostRequestAsync: () => {\n const notImplErr = \"Network interface - sendPostRequestAsync() has not been implemented for the Network interface.\";\n return Promise.reject(AuthError.createUnexpectedError(notImplErr));\n }\n};\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * ClientAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const JoseHeaderErrorMessage = {\n missingKidError: {\n code: \"missing_kid_error\",\n desc: \"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.\"\n },\n missingAlgError: {\n code: \"missing_alg_error\",\n desc: \"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided.\"\n },\n};\n\n/**\n * Error thrown when there is an error in the client code running on the browser.\n */\nexport class JoseHeaderError extends AuthError {\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n this.name = \"JoseHeaderError\";\n\n Object.setPrototypeOf(this, JoseHeaderError.prototype);\n }\n\n /**\n * Creates an error thrown when keyId isn't set on JOSE header.\n */\n static createMissingKidError(): JoseHeaderError {\n return new JoseHeaderError(JoseHeaderErrorMessage.missingKidError.code, JoseHeaderErrorMessage.missingKidError.desc);\n }\n\n /**\n * Creates an error thrown when algorithm isn't set on JOSE header.\n */\n static createMissingAlgError(): JoseHeaderError {\n return new JoseHeaderError(JoseHeaderErrorMessage.missingAlgError.code, JoseHeaderErrorMessage.missingAlgError.desc);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { JoseHeaderError } from \"../error/JoseHeaderError\";\nimport { JsonTypes } from \"../utils/Constants\";\n\nexport type JoseHeaderOptions = {\n typ?: JsonTypes,\n alg?: string,\n kid?: string\n};\n\nexport class JoseHeader {\n public typ?: JsonTypes;\n public alg?: string;\n public kid?: string;\n\n constructor (options: JoseHeaderOptions) {\n this.typ = options.typ;\n this.alg = options.alg;\n this.kid = options.kid;\n }\n\n /**\n * Builds SignedHttpRequest formatted JOSE Header from the\n * JOSE Header options provided or previously set on the object and returns\n * the stringified header object.\n * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.\n * @param shrHeaderOptions \n * @returns \n */\n static getShrHeaderString(shrHeaderOptions: JoseHeaderOptions): string {\n // KeyID is required on the SHR header\n if (!shrHeaderOptions.kid) {\n throw JoseHeaderError.createMissingKidError();\n }\n\n // Alg is required on the SHR header\n if (!shrHeaderOptions.alg) {\n throw JoseHeaderError.createMissingAlgError();\n }\n\n const shrHeader = new JoseHeader({\n // Access Token PoP headers must have type JWT, but the type header can be overriden for special cases\n typ: shrHeaderOptions.typ || JsonTypes.Jwt,\n kid: shrHeaderOptions.kid,\n alg: shrHeaderOptions.alg\n });\n\n return JSON.stringify(shrHeader);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { Constants, HeaderNames } from \"../utils/Constants\";\n\ntype WWWAuthenticateChallenges = {\n nonce?: string,\n};\n\ntype AuthenticationInfoChallenges = {\n nextnonce?: string\n};\n\n/**\n * This is a helper class that parses supported HTTP response authentication headers to extract and return\n * header challenge values that can be used outside the basic authorization flows.\n */\nexport class AuthenticationHeaderParser {\n private headers: Record;\n\n constructor(headers: Record) {\n this.headers = headers;\n }\n\n /**\n * This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.\n * @returns \n */\n getShrNonce(): string {\n // Attempt to parse nonce from Authentiacation-Info\n const authenticationInfo = this.headers[HeaderNames.AuthenticationInfo];\n if (authenticationInfo) {\n const authenticationInfoChallenges = this.parseChallenges(authenticationInfo);\n if (authenticationInfoChallenges.nextnonce) {\n return authenticationInfoChallenges.nextnonce;\n }\n throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.AuthenticationInfo, \"nextnonce challenge is missing.\");\n }\n\n // Attempt to parse nonce from WWW-Authenticate\n const wwwAuthenticate = this.headers[HeaderNames.WWWAuthenticate];\n if (wwwAuthenticate) {\n const wwwAuthenticateChallenges = this.parseChallenges(wwwAuthenticate); \n if (wwwAuthenticateChallenges.nonce){\n return wwwAuthenticateChallenges.nonce;\n }\n throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.WWWAuthenticate, \"nonce challenge is missing.\");\n }\n\n // If neither header is present, throw missing headers error\n throw ClientConfigurationError.createMissingNonceAuthenticationHeadersError();\n }\n\n /**\n * Parses an HTTP header's challenge set into a key/value map.\n * @param header \n * @returns \n */\n private parseChallenges(header: string): T {\n const schemeSeparator = header.indexOf(\" \");\n const challenges = header.substr(schemeSeparator + 1).split(\",\");\n const challengeMap = {} as T;\n\n challenges.forEach((challenge: string) => {\n const [ key, value ] = challenge.split(\"=\");\n // Remove escaped quotation marks (', \") from challenge string to keep only the challenge value\n challengeMap[key] = unescape(value.replace(/['\"]+/g, Constants.EMPTY_STRING));\n });\n\n return challengeMap;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SERVER_TELEM_CONSTANTS, Separators, CacheOutcome, Constants, RegionDiscoverySources, RegionDiscoveryOutcomes } from \"../../utils/Constants\";\nimport { CacheManager } from \"../../cache/CacheManager\";\nimport { AuthError } from \"../../error/AuthError\";\nimport { ServerTelemetryRequest } from \"./ServerTelemetryRequest\";\nimport { ServerTelemetryEntity } from \"../../cache/entities/ServerTelemetryEntity\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { RegionDiscoveryMetadata } from \"../../authority/RegionDiscoveryMetadata\";\n\nexport class ServerTelemetryManager {\n private cacheManager: CacheManager;\n private apiId: number;\n private correlationId: string;\n private telemetryCacheKey: string;\n private wrapperSKU: String;\n private wrapperVer: String;\n private regionUsed: string | undefined;\n private regionSource: RegionDiscoverySources | undefined;\n private regionOutcome: RegionDiscoveryOutcomes | undefined;\n private cacheOutcome: CacheOutcome = CacheOutcome.NO_CACHE_HIT;\n\n constructor(telemetryRequest: ServerTelemetryRequest, cacheManager: CacheManager) {\n this.cacheManager = cacheManager;\n this.apiId = telemetryRequest.apiId;\n this.correlationId = telemetryRequest.correlationId;\n this.wrapperSKU = telemetryRequest.wrapperSKU || Constants.EMPTY_STRING;\n this.wrapperVer = telemetryRequest.wrapperVer || Constants.EMPTY_STRING;\n\n this.telemetryCacheKey = SERVER_TELEM_CONSTANTS.CACHE_KEY + Separators.CACHE_KEY_SEPARATOR + telemetryRequest.clientId;\n }\n\n /**\n * API to add MSER Telemetry to request\n */\n generateCurrentRequestHeaderValue(): string {\n const request = `${this.apiId}${SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR}${this.cacheOutcome}`;\n const platformFields = [this.wrapperSKU, this.wrapperVer].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n const regionDiscoveryFields = this.getRegionDiscoveryFields();\n const requestWithRegionDiscoveryFields = [request, regionDiscoveryFields].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n\n return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, requestWithRegionDiscoveryFields, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\n }\n\n /**\n * API to add MSER Telemetry for the last failed request\n */\n generateLastRequestHeaderValue(): string {\n const lastRequests = this.getLastRequests();\n\n const maxErrors = ServerTelemetryManager.maxErrorsToSend(lastRequests);\n const failedRequests = lastRequests.failedRequests.slice(0, 2*maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n const errors = lastRequests.errors.slice(0, maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n const errorCount = lastRequests.errors.length;\n\n // Indicate whether this header contains all data or partial data\n const overflow = maxErrors < errorCount ? SERVER_TELEM_CONSTANTS.OVERFLOW_TRUE : SERVER_TELEM_CONSTANTS.OVERFLOW_FALSE;\n const platformFields = [errorCount, overflow].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n\n return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, lastRequests.cacheHits, failedRequests, errors, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\n }\n\n /**\n * API to cache token failures for MSER data capture\n * @param error\n */\n cacheFailedRequest(error: AuthError): void {\n const lastRequests = this.getLastRequests();\n if (lastRequests.errors.length >= SERVER_TELEM_CONSTANTS.MAX_CACHED_ERRORS) {\n // Remove a cached error to make room, first in first out\n lastRequests.failedRequests.shift(); // apiId\n lastRequests.failedRequests.shift(); // correlationId\n lastRequests.errors.shift();\n }\n \n lastRequests.failedRequests.push(this.apiId, this.correlationId);\n\n if (!StringUtils.isEmpty(error.subError)) {\n lastRequests.errors.push(error.subError);\n } else if (!StringUtils.isEmpty(error.errorCode)) {\n lastRequests.errors.push(error.errorCode);\n } else if (!!error && error.toString()) {\n lastRequests.errors.push(error.toString());\n } else {\n lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);\n }\n\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\n\n return;\n }\n\n /**\n * Update server telemetry cache entry by incrementing cache hit counter\n */\n incrementCacheHits(): number {\n const lastRequests = this.getLastRequests();\n lastRequests.cacheHits += 1;\n\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\n return lastRequests.cacheHits;\n }\n\n /**\n * Get the server telemetry entity from cache or initialize a new one\n */\n getLastRequests(): ServerTelemetryEntity {\n const initialValue: ServerTelemetryEntity = new ServerTelemetryEntity();\n const lastRequests = this.cacheManager.getServerTelemetry(this.telemetryCacheKey) as ServerTelemetryEntity;\n\n return lastRequests || initialValue;\n }\n\n /**\n * Remove server telemetry cache entry\n */\n clearTelemetryCache(): void {\n const lastRequests = this.getLastRequests();\n const numErrorsFlushed = ServerTelemetryManager.maxErrorsToSend(lastRequests);\n const errorCount = lastRequests.errors.length;\n if (numErrorsFlushed === errorCount) {\n // All errors were sent on last request, clear Telemetry cache\n this.cacheManager.removeItem(this.telemetryCacheKey);\n } else {\n // Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed\n const serverTelemEntity = new ServerTelemetryEntity();\n serverTelemEntity.failedRequests = lastRequests.failedRequests.slice(numErrorsFlushed*2); // failedRequests contains 2 items for each error\n serverTelemEntity.errors = lastRequests.errors.slice(numErrorsFlushed);\n\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);\n }\n }\n\n /**\n * Returns the maximum number of errors that can be flushed to the server in the next network request\n * @param serverTelemetryEntity\n */\n static maxErrorsToSend(serverTelemetryEntity: ServerTelemetryEntity): number {\n let i;\n let maxErrors = 0;\n let dataSize = 0;\n const errorCount = serverTelemetryEntity.errors.length;\n for (i = 0; i < errorCount; i++) {\n // failedRequests parameter contains pairs of apiId and correlationId, multiply index by 2 to preserve pairs\n const apiId = serverTelemetryEntity.failedRequests[2*i] || Constants.EMPTY_STRING;\n const correlationId = serverTelemetryEntity.failedRequests[2*i + 1] || Constants.EMPTY_STRING;\n const errorCode = serverTelemetryEntity.errors[i] || Constants.EMPTY_STRING;\n\n // Count number of characters that would be added to header, each character is 1 byte. Add 3 at the end to account for separators\n dataSize += apiId.toString().length + correlationId.toString().length + errorCode.length + 3;\n\n if (dataSize < SERVER_TELEM_CONSTANTS.MAX_LAST_HEADER_BYTES) {\n // Adding this entry to the header would still keep header size below the limit\n maxErrors += 1;\n } else {\n break;\n }\n }\n\n return maxErrors;\n }\n\n /**\n * Get the region discovery fields\n * \n * @returns string\n */\n getRegionDiscoveryFields(): string {\n const regionDiscoveryFields: string[] = [];\n\n regionDiscoveryFields.push(this.regionUsed || Constants.EMPTY_STRING);\n regionDiscoveryFields.push(this.regionSource || Constants.EMPTY_STRING);\n regionDiscoveryFields.push(this.regionOutcome || Constants.EMPTY_STRING);\n\n return regionDiscoveryFields.join(\",\");\n }\n\n /**\n * Update the region discovery metadata\n * \n * @param regionDiscoveryMetadata\n * @returns void\n */\n updateRegionDiscoveryMetadata(regionDiscoveryMetadata: RegionDiscoveryMetadata): void {\n this.regionUsed = regionDiscoveryMetadata.region_used;\n this.regionSource = regionDiscoveryMetadata.region_source;\n this.regionOutcome = regionDiscoveryMetadata.region_outcome;\n }\n\n /**\n * Set cache outcome \n */\n setCacheOutcome(cacheOutcome: CacheOutcome): void {\n this.cacheOutcome = cacheOutcome;\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ApplicationTelemetry } from \"../../config/ClientConfiguration\";\nimport { Logger } from \"../../logger/Logger\";\nimport { InProgressPerformanceEvent, IPerformanceClient, PerformanceCallbackFunction } from \"./IPerformanceClient\";\nimport { IPerformanceMeasurement } from \"./IPerformanceMeasurement\";\nimport { PerformanceEvent, PerformanceEvents, PerformanceEventStatus } from \"./PerformanceEvent\";\n\nexport abstract class PerformanceClient implements IPerformanceClient {\n protected authority: string;\n protected libraryName: string;\n protected libraryVersion: string;\n protected applicationTelemetry: ApplicationTelemetry;\n protected clientId: string;\n protected logger: Logger;\n protected callbacks: Map;\n\n /**\n * Multiple events with the same correlation id.\n * Double keyed by correlation id and event id.\n * @protected\n * @type {Map>}\n */\n protected eventsByCorrelationId: Map>;\n\n /**\n * Underlying performance measurements for each operation\n *\n * @protected\n * @type {Map}\n */\n protected measurementsById: Map;\n\n /**\n * Creates an instance of PerformanceClient, \n * an abstract class containing core performance telemetry logic.\n *\n * @constructor\n * @param {string} clientId Client ID of the application\n * @param {string} authority Authority used by the application\n * @param {Logger} logger Logger used by the application\n * @param {string} libraryName Name of the library\n * @param {string} libraryVersion Version of the library\n */\n constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry) {\n this.authority = authority;\n this.libraryName = libraryName;\n this.libraryVersion = libraryVersion;\n this.applicationTelemetry = applicationTelemetry;\n this.clientId = clientId;\n this.logger = logger;\n this.callbacks = new Map();\n this.eventsByCorrelationId = new Map();\n this.measurementsById = new Map();\n }\n\n /**\n * Starts and returns an platform-specific implementation of IPerformanceMeasurement.\n *\n * @abstract\n * @param {string} measureName\n * @param {string} correlationId\n * @returns {IPerformanceMeasurement}\n */\n abstract startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;\n\n /**\n * Generates and returns a unique id, typically a guid.\n *\n * @abstract\n * @returns {string}\n */\n abstract generateId(): string;\n\n /**\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\n *\n * @param {PerformanceEvents} measureName\n * @param {?string} [correlationId]\n * @returns {InProgressPerformanceEvent}\n */\n startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent {\n // Generate a placeholder correlation if the request does not provide one\n const eventCorrelationId = correlationId || this.generateId();\n if (!correlationId) {\n this.logger.info(`PerformanceClient: No correlation id provided for ${measureName}, generating`, eventCorrelationId);\n }\n\n this.logger.trace(`PerformanceClient: Performance measurement started for ${measureName}`, eventCorrelationId);\n const performanceMeasurement = this.startPerformanceMeasuremeant(measureName, eventCorrelationId);\n performanceMeasurement.startMeasurement();\n\n const inProgressEvent: PerformanceEvent = {\n eventId: this.generateId(),\n status: PerformanceEventStatus.InProgress,\n authority: this.authority,\n libraryName: this.libraryName,\n libraryVersion: this.libraryVersion,\n appName: this.applicationTelemetry?.appName,\n appVersion: this.applicationTelemetry?.appVersion,\n clientId: this.clientId,\n name: measureName,\n startTimeMs: Date.now(),\n correlationId: eventCorrelationId,\n };\n\n // Store in progress events so they can be discarded if not ended properly\n this.cacheEventByCorrelationId(inProgressEvent);\n this.cacheMeasurement(inProgressEvent, performanceMeasurement);\n\n // Return the event and functions the caller can use to properly end/flush the measurement\n return {\n endMeasurement: (event?: Partial): PerformanceEvent | null => {\n const completedEvent = this.endMeasurement({\n // Initial set of event properties\n ...inProgressEvent,\n // Properties set when event ends\n ...event\n });\n\n if (completedEvent) {\n // Cache event so that submeasurements can be added downstream\n this.cacheEventByCorrelationId(completedEvent);\n }\n\n return completedEvent;\n },\n flushMeasurement: () => {\n return this.flushMeasurements(inProgressEvent.name, inProgressEvent.correlationId);\n },\n discardMeasurement: () => {\n return this.discardMeasurements(inProgressEvent.correlationId);\n },\n measurement: performanceMeasurement,\n event: inProgressEvent\n };\n\n }\n\n /**\n * Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes,\n * as consumers should instead use the function returned by startMeasurement.\n *\n * @param {PerformanceEvent} event\n * @returns {(PerformanceEvent | null)}\n */\n endMeasurement(event: PerformanceEvent): PerformanceEvent | null {\n const performanceMeasurement = this.measurementsById.get(event.eventId);\n if (performanceMeasurement) {\n // Immediately delete so that the same event isnt ended twice\n this.measurementsById.delete(event.eventId);\n performanceMeasurement.endMeasurement();\n const durationMs = performanceMeasurement.flushMeasurement();\n // null indicates no measurement was taken (e.g. needed performance APIs not present)\n if (durationMs !== null) {\n this.logger.trace(`PerformanceClient: Performance measurement ended for ${event.name}: ${durationMs} ms`, event.correlationId);\n\n const completedEvent: PerformanceEvent = {\n // Allow duration to be overwritten when event ends (e.g. testing), but not status\n durationMs: Math.round(durationMs),\n ...event,\n status: PerformanceEventStatus.Completed,\n };\n\n return completedEvent;\n } else {\n this.logger.trace(\"PerformanceClient: Performance measurement not taken\", event.correlationId);\n }\n } else {\n this.logger.trace(`PerformanceClient: Measurement not found for ${event.eventId}`, event.correlationId);\n }\n\n return null;\n }\n\n /**\n * Upserts event into event cache.\n * First key is the correlation id, second key is the event id.\n * Allows for events to be grouped by correlation id,\n * and to easily allow for properties on them to be updated.\n *\n * @private\n * @param {PerformanceEvent} event\n */\n private cacheEventByCorrelationId(event: PerformanceEvent) {\n const existingEvents = this.eventsByCorrelationId.get(event.correlationId);\n if (existingEvents) {\n this.logger.trace(`PerformanceClient: Performance measurement for ${event.name} added/updated`, event.correlationId);\n existingEvents.set(event.eventId, event);\n } else {\n this.logger.trace(`PerformanceClient: Performance measurement for ${event.name} started`, event.correlationId);\n this.eventsByCorrelationId.set(event.correlationId, new Map().set(event.eventId, event));\n }\n }\n\n /**\n * Cache measurements by their id.\n *\n * @private\n * @param {PerformanceEvent} event\n * @param {IPerformanceMeasurement} measurement\n */\n private cacheMeasurement(event: PerformanceEvent, measurement: IPerformanceMeasurement) {\n this.measurementsById.set(event.eventId, measurement);\n }\n\n /**\n * Gathers and emits performance events for measurements taked for the given top-level API and correlation ID.\n *\n * @param {PerformanceEvents} measureName\n * @param {string} correlationId\n */\n flushMeasurements(measureName: PerformanceEvents, correlationId: string): void {\n this.logger.trace(`PerformanceClient: Performance measurements flushed for ${measureName}`, correlationId);\n const eventsForCorrelationId = this.eventsByCorrelationId.get(correlationId);\n if (eventsForCorrelationId) {\n this.discardMeasurements(correlationId);\n\n /*\n * Manually end incomplete submeasurements to ensure there arent orphaned/never ending events.\n * Incomplete submeasurements are likely an instrumentation bug that should be fixed.\n * IE only supports Map.forEach.\n */\n const completedEvents: PerformanceEvent[] = [];\n eventsForCorrelationId.forEach(event => {\n if (event.name !== measureName && event.status !== PerformanceEventStatus.Completed) {\n this.logger.trace(`PerformanceClient: Incomplete submeasurement ${event.name} found for ${measureName}`, correlationId);\n\n const completedEvent = this.endMeasurement(event);\n if (completedEvent) {\n completedEvents.push(completedEvent);\n }\n }\n\n completedEvents.push(event);\n });\n\n // Sort events by start time (earliest first)\n const sortedCompletedEvents = completedEvents.sort((eventA, eventB) => eventA.startTimeMs - eventB.startTimeMs);\n\n // Take completed top level event and add completed submeasurements durations as properties\n const topLevelEvents = sortedCompletedEvents.filter(event => event.name === measureName && event.status === PerformanceEventStatus.Completed);\n if (topLevelEvents.length > 0) {\n /*\n * Only take the first top-level event if there are multiple events with the same correlation id.\n * This greatly simplifies logic for submeasurements.\n */\n if (topLevelEvents.length > 1) {\n this.logger.verbose(\"PerformanceClient: Multiple distinct top-level performance events found, using the first\", correlationId);\n }\n const topLevelEvent = topLevelEvents[0];\n\n this.logger.verbose(`PerformanceClient: Measurement found for ${measureName}`, correlationId);\n\n // Build event object with top level and sub measurements\n const eventToEmit = sortedCompletedEvents.reduce((previous, current) => {\n if (current.name !== measureName) {\n this.logger.trace(`PerformanceClient: Complete submeasurement found for ${current.name}`, correlationId);\n // TODO: Emit additional properties for each subMeasurement\n const subMeasurementName = `${current.name}DurationMs`;\n /*\n * Some code paths, such as resolving an authority, can occur multiple times.\n * Only take the first measurement, since the second could be read from the cache,\n * or due to the same correlation id being used for two distinct requests.\n */\n if (!previous[subMeasurementName]) {\n previous[subMeasurementName] = current.durationMs;\n } else {\n this.logger.verbose(`PerformanceClient: Submeasurement for ${measureName} already exists for ${current.name}, ignoring`, correlationId);\n }\n if (current.accessTokenSize) {\n previous.accessTokenSize = current.accessTokenSize;\n }\n if (current.idTokenSize) {\n previous.idTokenSize = current.idTokenSize;\n }\n if (current.refreshTokenSize) {\n previous.refreshTokenSize = current.refreshTokenSize;\n }\n }\n\n return previous;\n }, topLevelEvent);\n\n this.emitEvents([eventToEmit], eventToEmit.correlationId);\n } else {\n this.logger.verbose(`PerformanceClient: No completed top-level measurements found for ${measureName}`, correlationId);\n }\n } else {\n this.logger.verbose(\"PerformanceClient: No measurements found\", correlationId);\n }\n }\n\n /**\n * Removes measurements for a given correlation id.\n *\n * @param {string} correlationId\n */\n discardMeasurements(correlationId: string): void {\n this.logger.trace(\"PerformanceClient: Performance measurements discarded\", correlationId);\n this.eventsByCorrelationId.delete(correlationId);\n }\n\n /**\n * Registers a callback function to receive performance events.\n *\n * @param {PerformanceCallbackFunction} callback\n * @returns {string}\n */\n addPerformanceCallback(callback: PerformanceCallbackFunction): string {\n const callbackId = this.generateId();\n this.callbacks.set(callbackId, callback);\n this.logger.verbose(`PerformanceClient: Performance callback registered with id: ${callbackId}`);\n\n return callbackId;\n }\n\n /**\n * Removes a callback registered with addPerformanceCallback.\n *\n * @param {string} callbackId\n * @returns {boolean}\n */\n removePerformanceCallback(callbackId: string): boolean {\n const result = this.callbacks.delete(callbackId);\n\n if (result) {\n this.logger.verbose(`PerformanceClient: Performance callback ${callbackId} removed.`);\n } else {\n this.logger.verbose(`PerformanceClient: Performance callback ${callbackId} not removed.`);\n }\n\n return result;\n }\n\n /**\n * Emits events to all registered callbacks.\n *\n * @param {PerformanceEvent[]} events\n * @param {?string} [correlationId]\n */\n emitEvents(events: PerformanceEvent[], correlationId: string): void {\n this.logger.verbose(\"PerformanceClient: Emitting performance events\", correlationId);\n\n this.callbacks.forEach((callback: PerformanceCallbackFunction, callbackId: string) => {\n this.logger.trace(`PerformanceClient: Emitting event to callback ${callbackId}`, correlationId);\n callback.apply(null, [events]);\n });\n }\n\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IPerformanceClient } from \"./IPerformanceClient\";\nimport { IPerformanceMeasurement } from \"./IPerformanceMeasurement\";\nimport { PerformanceClient } from \"./PerformanceClient\";\n\nexport class StubPerformanceMeasurement implements IPerformanceMeasurement {\n /* eslint-disable-next-line @typescript-eslint/no-empty-function */\n startMeasurement(): void { }\n /* eslint-disable-next-line @typescript-eslint/no-empty-function */\n endMeasurement(): void { }\n flushMeasurement(): number | null {\n return null;\n }\n \n}\n\nexport class StubPerformanceClient extends PerformanceClient implements IPerformanceClient {\n generateId(): string {\n return \"callback-id\";\n }\n \n startPerformanceMeasuremeant(): IPerformanceMeasurement {\n return new StubPerformanceMeasurement();\n }\n}\n"],"names":["HeaderNames","PersistentCacheKeys","AADServerParamKeys","ClaimsRequestKeys","SSOTypes","ResponseMode","CacheAccountType","CredentialType","CacheSchemaType","CacheType","AuthenticationScheme","PasswordGrantConstants","LogLevel","AzureCloudInstance","AuthorityType","CcsCredentialType","PerformanceEvents","PerformanceEventStatus","ProtocolMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;AAGG;AAEU,IAAA,SAAS,GAAG;AACrB,IAAA,YAAY,EAAE,SAAS;AACvB,IAAA,GAAG,EAAE,gBAAgB;;AAErB,IAAA,YAAY,EAAE,MAAM;;AAEpB,IAAA,iBAAiB,EAAE,2CAA2C;AAC9D,IAAA,sBAAsB,EAAE,2BAA2B;AACnD,IAAA,qBAAqB,EAAE,QAAQ;;AAE/B,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,EAAE,QAAQ;;AAEd,IAAA,4BAA4B,EAAE,qGAAqG;;AAEnI,IAAA,cAAc,EAAE,GAAG;;AAEnB,IAAA,UAAU,EAAE,YAAY;;AAExB,IAAA,MAAM,EAAE,QAAQ;;AAEhB,IAAA,aAAa,EAAE,sCAAsC;;AAErD,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,aAAa,EAAE,SAAS;AACxB,IAAA,oBAAoB,EAAE,gBAAgB;AACtC,IAAA,WAAW,EAAE,OAAO;;AAEpB,IAAA,kBAAkB,EAAE,MAA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