{"version":3,"file":"StandardInteractionClient.js","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerTelemetryManager, CommonAuthorizationCodeRequest, Constants, AuthorizationCodeClient, ClientConfiguration, AuthorityOptions, Authority, AuthorityFactory, ServerAuthorizationCodeResponse, UrlString, CommonEndSessionRequest, ProtocolUtils, ResponseMode, StringUtils, IdTokenClaims, AccountInfo, AzureCloudOptions, PerformanceEvents, AuthError} from \"@azure/msal-common\";\nimport { BaseInteractionClient } from \"./BaseInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConstants, InteractionType } from \"../utils/BrowserConstants\";\nimport { version } from \"../packageMetadata\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { BrowserProtocolUtils, BrowserStateObject } from \"../utils/BrowserProtocolUtils\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\n\n/**\n * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\n */\nexport abstract class StandardInteractionClient extends BaseInteractionClient {\n /**\n * Generates an auth code request tied to the url request.\n * @param request\n */\n protected async initializeAuthorizationCodeRequest(request: AuthorizationUrlRequest): Promise {\n this.logger.verbose(\"initializeAuthorizationRequest called\", request.correlationId);\n const generatedPkceParams = await this.browserCrypto.generatePkceCodes();\n\n const authCodeRequest: CommonAuthorizationCodeRequest = {\n ...request,\n redirectUri: request.redirectUri,\n code: Constants.EMPTY_STRING,\n codeVerifier: generatedPkceParams.verifier\n };\n\n request.codeChallenge = generatedPkceParams.challenge;\n request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;\n\n return authCodeRequest;\n }\n\n /**\n * Initializer for the logout request.\n * @param logoutRequest\n */\n protected initializeLogoutRequest(logoutRequest?: EndSessionRequest): CommonEndSessionRequest {\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest?.correlationId);\n\n const validLogoutRequest: CommonEndSessionRequest = {\n correlationId: this.correlationId || this.browserCrypto.createNewGuid(),\n ...logoutRequest\n };\n\n /**\n * Set logout_hint to be login_hint from ID Token Claims if present\n * and logoutHint attribute wasn't manually set in logout request\n */\n if (logoutRequest) {\n // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims\n if (!logoutRequest.logoutHint) {\n if(logoutRequest.account) {\n const logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);\n if (logoutHint) {\n this.logger.verbose(\"Setting logoutHint to login_hint ID Token Claim value for the account provided\");\n validLogoutRequest.logoutHint = logoutHint;\n }\n } else {\n this.logger.verbose(\"logoutHint was not set and account was not passed into logout request, logoutHint will not be set\");\n }\n } else {\n this.logger.verbose(\"logoutHint has already been set in logoutRequest\");\n }\n } else {\n this.logger.verbose(\"logoutHint will not be set since no logout request was configured\");\n }\n\n /*\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\n * Otherwise, use passed uri, config, or current page.\n */\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else if (this.config.auth.postLogoutRedirectUri === null) {\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\n } else if (this.config.auth.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else {\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(BrowserUtils.getCurrentUri(), BrowserUtils.getCurrentUri());\n }\n } else {\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\n }\n\n return validLogoutRequest;\n }\n\n /**\n * Parses login_hint ID Token Claim out of AccountInfo object to be used as\n * logout_hint in end session request.\n * @param account\n */\n protected getLogoutHintFromIdTokenClaims(account: AccountInfo): string | null {\n const idTokenClaims: IdTokenClaims | undefined = account.idTokenClaims;\n if (idTokenClaims) {\n if (idTokenClaims.login_hint) {\n return idTokenClaims.login_hint;\n } else {\n this.logger.verbose(\"The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request\");\n }\n } else {\n this.logger.verbose(\"The provided account does not contain ID Token Claims, logoutHint will not be added to logout request\");\n }\n\n return null;\n }\n\n /**\n * Creates an Authorization Code Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise {\n // Create auth module.\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);\n return new AuthorizationCodeClient(clientConfig);\n }\n\n /**\n * Creates a Client Configuration object with the given request authority, or the default authority.\n * @param serverTelemetryManager\n * @param requestAuthority\n * @param requestCorrelationId\n */\n protected async getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise {\n this.logger.verbose(\"getClientConfiguration called\", this.correlationId);\n const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions);\n const logger= this.config.system.loggerOptions;\n\n return {\n authOptions: {\n clientId: this.config.auth.clientId,\n authority: discoveredAuthority,\n clientCapabilities: this.config.auth.clientCapabilities\n },\n systemOptions: {\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\n preventCorsPreflight: true\n },\n loggerOptions: {\n loggerCallback: logger.loggerCallback,\n piiLoggingEnabled: logger.piiLoggingEnabled,\n logLevel: logger.logLevel,\n correlationId: this.correlationId\n },\n cryptoInterface: this.browserCrypto,\n networkInterface: this.networkClient,\n storageInterface: this.browserStorage,\n serverTelemetryManager: serverTelemetryManager,\n libraryInfo: {\n sku: BrowserConstants.MSAL_SKU,\n version: version,\n cpu: Constants.EMPTY_STRING,\n os: Constants.EMPTY_STRING\n },\n telemetry: this.config.telemetry\n };\n }\n \n /**\n * @param hash\n * @param interactionType\n */\n protected validateAndExtractStateFromHash(serverParams: ServerAuthorizationCodeResponse, interactionType: InteractionType, requestCorrelationId?: string): string {\n this.logger.verbose(\"validateAndExtractStateFromHash called\", requestCorrelationId);\n if (!serverParams.state) {\n throw BrowserAuthError.createHashDoesNotContainStateError();\n }\n\n const platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);\n if (!platformStateObj) {\n throw BrowserAuthError.createUnableToParseStateError();\n }\n\n if (platformStateObj.interactionType !== interactionType) {\n throw BrowserAuthError.createStateInteractionTypeMismatchError();\n }\n\n this.logger.verbose(\"Returning state from hash\", requestCorrelationId);\n return serverParams.state;\n }\n\n /**\n * Used to get a discovered version of the default authority.\n * @param requestAuthority\n * @param requestCorrelationId\n */\n protected async getDiscoveredAuthority(requestAuthority?: string, requestAzureCloudOptions?: AzureCloudOptions): Promise {\n this.logger.verbose(\"getDiscoveredAuthority called\", this.correlationId);\n const getAuthorityMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\n const authorityOptions: AuthorityOptions = {\n protocolMode: this.config.auth.protocolMode,\n knownAuthorities: this.config.auth.knownAuthorities,\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\n authorityMetadata: this.config.auth.authorityMetadata,\n skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache\n };\n\n // build authority string based on auth params, precedence - azureCloudInstance + tenant >> authority\n const userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;\n\n // fall back to the authority from config\n const builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);\n this.logger.verbose(\"Creating discovered authority with configured authority\", this.correlationId);\n return await AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)\n .then((result: Authority) => {\n getAuthorityMeasurement.endMeasurement({\n success: true,\n });\n\n return result;\n })\n .catch((error:AuthError) => {\n getAuthorityMeasurement.endMeasurement({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false\n });\n\n throw error;\n });\n }\n\n /**\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\n * @param request\n * @param interactionType\n */\n protected async initializeAuthorizationRequest(request: RedirectRequest|PopupRequest|SsoSilentRequest, interactionType: InteractionType): Promise {\n this.logger.verbose(\"initializeAuthorizationRequest called\", this.correlationId);\n const redirectUri = this.getRedirectUri(request.redirectUri);\n const browserState: BrowserStateObject = {\n interactionType: interactionType\n };\n const state = ProtocolUtils.setRequestState(\n this.browserCrypto,\n (request && request.state)|| Constants.EMPTY_STRING,\n browserState\n );\n\n const validatedRequest: AuthorizationUrlRequest = {\n ...await this.initializeBaseRequest(request),\n redirectUri: redirectUri,\n state: state,\n nonce: request.nonce || this.browserCrypto.createNewGuid(),\n responseMode: ResponseMode.FRAGMENT\n };\n\n const account = request.account || this.browserStorage.getActiveAccount();\n if (account) {\n this.logger.verbose(\"Setting validated request account\", this.correlationId);\n this.logger.verbosePii(`Setting validated request account: ${account.homeAccountId}`, this.correlationId);\n validatedRequest.account = account;\n }\n\n // Check for ADAL/MSAL v1 SSO\n if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {\n const legacyLoginHint = this.browserStorage.getLegacyLoginHint();\n if (legacyLoginHint) {\n validatedRequest.loginHint = legacyLoginHint;\n }\n }\n\n return validatedRequest;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAkBA;;;;IAGwD,6CAAqB;IAA7E;;KAmQC;;;;;IA9PmB,sEAAkC,GAAlD,UAAmD,OAAgC;;;;;;wBAC/E,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uCAAuC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBACxD,qBAAM,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,EAAA;;wBAAlE,mBAAmB,GAAG,SAA4C;wBAElE,eAAe,yBACd,OAAO,KACV,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,IAAI,EAAE,SAAS,CAAC,YAAY,EAC5B,YAAY,EAAE,mBAAmB,CAAC,QAAQ,GAC7C,CAAC;wBAEF,OAAO,CAAC,aAAa,GAAG,mBAAmB,CAAC,SAAS,CAAC;wBACtD,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,0BAA0B,CAAC;wBAEnE,sBAAO,eAAe,EAAC;;;;KAC1B;;;;;IAMS,2DAAuB,GAAjC,UAAkC,aAAiC;QAC/D,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gCAAgC,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,aAAa,CAAC,CAAC;QAEpF,IAAM,kBAAkB,cACpB,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,IACpE,aAAa,CACnB,CAAC;;;;;QAMF,IAAI,aAAa,EAAE;;YAEf,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;gBAC3B,IAAG,aAAa,CAAC,OAAO,EAAE;oBACtB,IAAM,UAAU,GAAG,IAAI,CAAC,8BAA8B,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;oBAC9E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