{"version":3,"file":"auth-flow-CWAq4eQH.js","sources":["../../../src/packages/core/auth/components/auth-provider-default.element.ts","../../../src/packages/core/auth/constants.ts","../../../src/packages/core/auth/auth-flow.ts"],"sourcesContent":["import type { UmbAuthProviderDefaultProps, UmbUserLoginState } from '../types.js';\r\nimport type { ManifestAuthProvider } from '../auth-provider.extension.js';\r\nimport { css, customElement, html, nothing, property } from '@umbraco-cms/backoffice/external/lit';\r\nimport { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';\r\nimport { UmbTextStyles } from '@umbraco-cms/backoffice/style';\r\n\r\n@customElement('umb-auth-provider-default')\r\nexport class UmbAuthProviderDefaultElement extends UmbLitElement implements UmbAuthProviderDefaultProps {\r\n\t@property({ attribute: false })\r\n\tuserLoginState?: UmbUserLoginState | undefined;\r\n\r\n\t@property({ attribute: false })\r\n\tmanifest!: ManifestAuthProvider;\r\n\r\n\t@property({ attribute: false })\r\n\tonSubmit!: (manifestOrProviderName: string | ManifestAuthProvider, loginHint?: string) => void;\r\n\r\n\toverride connectedCallback(): void {\r\n\t\tsuper.connectedCallback();\r\n\t\tthis.setAttribute('part', 'auth-provider-default');\r\n\t}\r\n\r\n\tget #label() {\r\n\t\tconst label = this.manifest.meta?.label ?? this.manifest.forProviderName;\r\n\t\tconst labelLocalized = this.localize.string(label);\r\n\t\treturn this.localize.term('login_signInWith', labelLocalized);\r\n\t}\r\n\r\n\toverride render() {\r\n\t\treturn html`\r\n\t\t\t this.onSubmit(this.manifest)}\r\n\t\t\t\tid=\"auth-provider-button\"\r\n\t\t\t\t.label=${this.#label}\r\n\t\t\t\t.look=${this.manifest.meta?.defaultView?.look ?? 'outline'}\r\n\t\t\t\t.color=${this.manifest.meta?.defaultView?.color ?? 'default'}>\r\n\t\t\t\t${this.manifest.meta?.defaultView?.icon\r\n\t\t\t\t\t? html``\r\n\t\t\t\t\t: nothing}\r\n\t\t\t\t${this.#label}\r\n\t\t\t\r\n\t\t`;\r\n\t}\r\n\r\n\tstatic override styles = [\r\n\t\tUmbTextStyles,\r\n\t\tcss`\r\n\t\t\t:host {\r\n\t\t\t\tdisplay: block;\r\n\t\t\t}\r\n\r\n\t\t\t#auth-provider-button {\r\n\t\t\t\twidth: 100%;\r\n\t\t\t}\r\n\r\n\t\t\t#icon {\r\n\t\t\t\tmargin-right: var(--uui-size-space-1);\r\n\t\t\t}\r\n\t\t`,\r\n\t];\r\n}\r\n\r\ndeclare global {\r\n\tinterface HTMLElementTagNameMap {\r\n\t\t'umb-auth-provider-default': UmbAuthProviderDefaultElement;\r\n\t}\r\n}\r\n","export const UMB_STORAGE_TOKEN_RESPONSE_NAME = 'umb:userAuthTokenResponse';\r\n","/*\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n * use this file except in compliance with the License. You may obtain a copy of\r\n * the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n * License for the specific language governing permissions and limitations under\r\n * the License.\r\n */\r\nimport { UMB_STORAGE_TOKEN_RESPONSE_NAME } from './constants.js';\r\nimport type { LocationLike, StringMap } from '@umbraco-cms/backoffice/external/openid';\r\nimport {\r\n\tBaseTokenRequestHandler,\r\n\tBasicQueryStringUtils,\r\n\tFetchRequestor,\r\n\tLocalStorageBackend,\r\n\tRedirectRequestHandler,\r\n\tAuthorizationRequest,\r\n\tAuthorizationNotifier,\r\n\tAuthorizationServiceConfiguration,\r\n\tGRANT_TYPE_AUTHORIZATION_CODE,\r\n\tGRANT_TYPE_REFRESH_TOKEN,\r\n\tRevokeTokenRequest,\r\n\tTokenRequest,\r\n\tTokenResponse,\r\n} from '@umbraco-cms/backoffice/external/openid';\r\nimport { Subject } from '@umbraco-cms/backoffice/external/rxjs';\r\n\r\nconst requestor = new FetchRequestor();\r\n\r\n/**\r\n * This class is needed to prevent the hash from being parsed as part of the query string.\r\n */\r\nclass UmbNoHashQueryStringUtils extends BasicQueryStringUtils {\r\n\toverride parse(input: LocationLike) {\r\n\t\treturn super.parse(input, false);\r\n\t}\r\n}\r\n\r\n/**\r\n * This class is used to handle the auth flow through any backend supporting OpenID Connect.\r\n * It needs to know the server url, the client id, the redirect uri and the scope.\r\n *\r\n * For a default Umbraco installation, the server url is the base url of the Umbraco server.\r\n * and the client id is \"umbraco-back-office\"\r\n * and the scope is \"offline_access\"\r\n *\r\n * It will:\r\n * - Fetch the service configuration from the server\r\n * - Check if there is a token response in local storage\r\n * - If there is a token response, check if it is valid\r\n * - If it is not valid, check if there is a new authorization to be made\r\n * - If there is a new authorization to be made, complete it\r\n * - If there is no token response, check if there is a new authorization to be made\r\n * - If there is a new authorization to be made, complete it\r\n * - If there is no new authorization to be made, do nothing (= logged in)\r\n *\r\n * It will also:\r\n * - Save the token response in local storage\r\n * - Save the authorization code in local storage\r\n *\r\n * It will also provide methods to:\r\n * - Make a refresh token request\r\n * - Perform an action with fresh tokens\r\n * - Clear the token state (logout)\r\n *\r\n * It should be used as follows:\r\n * 1. Create an instance of this class\r\n * 2. Call the `setInitialState` method on startup\r\n * a. This will fetch the service configuration and check if there is a token response in the storage backend\r\n * b. If there is a token response, it will check if it is valid and if it is not, it will check if there is a new authorization to be made\r\n * which happens when the user is redirected back to the app after logging in\r\n * 3. Call the `makeAuthorizationRequest` method on all pages that need to be authorized\r\n * a. This will redirect the user to the authorization endpoint of the server\r\n * 4. After login, get the latest token before each request to the server by calling the `performWithFreshTokens` method\r\n */\r\nexport class UmbAuthFlow {\r\n\t// handlers\r\n\treadonly #notifier: AuthorizationNotifier;\r\n\treadonly #authorizationHandler: RedirectRequestHandler;\r\n\treadonly #tokenHandler: BaseTokenRequestHandler;\r\n\treadonly #storageBackend: LocalStorageBackend;\r\n\r\n\t// state\r\n\treadonly #configuration: AuthorizationServiceConfiguration;\r\n\treadonly #redirectUri: string;\r\n\treadonly #postLogoutRedirectUri: string;\r\n\treadonly #clientId: string;\r\n\treadonly #scope: string;\r\n\treadonly #timeoutSignal;\r\n\r\n\t// tokens\r\n\t#tokenResponse?: TokenResponse;\r\n\r\n\t// external login\r\n\t#link_endpoint;\r\n\t#link_key_endpoint;\r\n\t#unlink_endpoint;\r\n\r\n\t/**\r\n\t * This signal will emit when the authorization flow is complete.\r\n\t * @remark It will also emit if there is an error during the authorization flow.\r\n\t */\r\n\treadonly authorizationSignal = new Subject();\r\n\r\n\tconstructor(\r\n\t\topenIdConnectUrl: string,\r\n\t\tredirectUri: string,\r\n\t\tpostLogoutRedirectUri: string,\r\n\t\ttimeoutSignal: Subject,\r\n\t\tclientId = 'umbraco-back-office',\r\n\t\tscope = 'offline_access',\r\n\t) {\r\n\t\tthis.#redirectUri = redirectUri;\r\n\t\tthis.#postLogoutRedirectUri = postLogoutRedirectUri;\r\n\t\tthis.#timeoutSignal = timeoutSignal;\r\n\t\tthis.#clientId = clientId;\r\n\t\tthis.#scope = scope;\r\n\r\n\t\tthis.#configuration = new AuthorizationServiceConfiguration({\r\n\t\t\tauthorization_endpoint: `${openIdConnectUrl}/umbraco/management/api/v1/security/back-office/authorize`,\r\n\t\t\ttoken_endpoint: `${openIdConnectUrl}/umbraco/management/api/v1/security/back-office/token`,\r\n\t\t\trevocation_endpoint: `${openIdConnectUrl}/umbraco/management/api/v1/security/back-office/revoke`,\r\n\t\t\tend_session_endpoint: `${openIdConnectUrl}/umbraco/management/api/v1/security/back-office/signout`,\r\n\t\t});\r\n\r\n\t\tthis.#link_endpoint = `${openIdConnectUrl}/umbraco/management/api/v1/security/back-office/link-login`;\r\n\t\tthis.#link_key_endpoint = `${openIdConnectUrl}/umbraco/management/api/v1/security/back-office/link-login-key`;\r\n\t\tthis.#unlink_endpoint = `${openIdConnectUrl}/umbraco/management/api/v1/security/back-office/unlink-login`;\r\n\r\n\t\tthis.#notifier = new AuthorizationNotifier();\r\n\t\tthis.#tokenHandler = new BaseTokenRequestHandler(requestor);\r\n\t\tthis.#storageBackend = new LocalStorageBackend();\r\n\t\tthis.#authorizationHandler = new RedirectRequestHandler(this.#storageBackend, new UmbNoHashQueryStringUtils());\r\n\r\n\t\t// set notifier to deliver responses\r\n\t\tthis.#authorizationHandler.setAuthorizationNotifier(this.#notifier);\r\n\r\n\t\t// set a listener to listen for authorization responses\r\n\t\tthis.#notifier.setAuthorizationListener(async (request, response, error) => {\r\n\t\t\tif (error) {\r\n\t\t\t\tconsole.error('Authorization error', error);\r\n\t\t\t\tthis.authorizationSignal.next();\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\tif (response) {\r\n\t\t\t\tlet codeVerifier: string | undefined;\r\n\t\t\t\tif (request.internal && request.internal.code_verifier) {\r\n\t\t\t\t\tcodeVerifier = request.internal.code_verifier;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tawait this.#makeTokenRequest(response.code, codeVerifier);\r\n\t\t\t\tawait this.performWithFreshTokens();\r\n\t\t\t\tawait this.#saveTokenState();\r\n\t\t\t}\r\n\r\n\t\t\tthis.authorizationSignal.next();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * This method will initialize all the state needed for the auth flow.\r\n\t *\r\n\t * It will:\r\n\t * - Check if there is a token response in local storage\r\n\t * - If there is a token response, check if it is valid\r\n\t * - If it is not valid, check if there is a new authorization to be made\r\n\t * - If there is a new authorization to be made, complete it\r\n\t * - If there is no token response, check if there is a new authorization to be made\r\n\t * - If there is a new authorization to be made, complete it\r\n\t */\r\n\tasync setInitialState() {\r\n\t\tconst tokenResponseJson = await this.#storageBackend.getItem(UMB_STORAGE_TOKEN_RESPONSE_NAME);\r\n\t\tif (tokenResponseJson) {\r\n\t\t\tconst response = new TokenResponse(JSON.parse(tokenResponseJson));\r\n\t\t\tthis.#tokenResponse = response;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This method will check if there is a new authorization to be made and complete it if there is.\r\n\t * This method will be called on initialization to check if there is a new authorization to be made.\r\n\t * It is useful if there is a ?code query string parameter in the URL from the server or if the auth flow\r\n\t * saved the state in local storage before redirecting the user to the login page.\r\n\t */\r\n\tcompleteAuthorizationIfPossible() {\r\n\t\treturn this.#authorizationHandler.completeAuthorizationRequestIfPossible();\r\n\t}\r\n\r\n\t/**\r\n\t * Make an authorization request to the server using the specified identity provider.\r\n\t * This method will redirect the user to the authorization endpoint of the server.\r\n\t * @param identityProvider The identity provider to use for the authorization request.\r\n\t * @param usernameHint (Optional) The username to use for the authorization request. It will be provided to the OpenID server as a hint.\r\n\t */\r\n\tmakeAuthorizationRequest(identityProvider: string, usernameHint?: string) {\r\n\t\tconst extras: StringMap = { prompt: 'consent', access_type: 'offline' };\r\n\r\n\t\t// If the identity provider is not 'Umbraco', we will add it to the extras.\r\n\t\tif (identityProvider !== 'Umbraco') {\r\n\t\t\textras['identity_provider'] = identityProvider;\r\n\t\t}\r\n\r\n\t\t// If there is a username hint, we will add it to the extras.\r\n\t\tif (usernameHint) {\r\n\t\t\textras['login_hint'] = usernameHint;\r\n\t\t}\r\n\r\n\t\t// create a request\r\n\t\tconst request = new AuthorizationRequest(\r\n\t\t\t{\r\n\t\t\t\tclient_id: this.#clientId,\r\n\t\t\t\tredirect_uri: this.#redirectUri,\r\n\t\t\t\tscope: this.#scope,\r\n\t\t\t\tresponse_type: AuthorizationRequest.RESPONSE_TYPE_CODE,\r\n\t\t\t\tstate: undefined,\r\n\t\t\t\textras: extras,\r\n\t\t\t},\r\n\t\t\tundefined,\r\n\t\t\ttrue,\r\n\t\t);\r\n\r\n\t\treturn this.#authorizationHandler.performAuthorizationRequest(this.#configuration, request);\r\n\t}\r\n\r\n\t/**\r\n\t * This method will check if the user is logged in by validating if there is a token stored.\r\n\t * If no token is stored, it will return false.\r\n\t * @returns true if the user is logged in, false otherwise.\r\n\t */\r\n\tisAuthorized(): boolean {\r\n\t\treturn !!this.#tokenResponse;\r\n\t}\r\n\r\n\t/**\r\n\t * Forget all cached token state\r\n\t */\r\n\tasync clearTokenStorage() {\r\n\t\tawait this.#storageBackend.removeItem(UMB_STORAGE_TOKEN_RESPONSE_NAME);\r\n\r\n\t\t// clear the internal state\r\n\t\tthis.#tokenResponse = undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * This method will sign the user out of the application.\r\n\t */\r\n\tasync signOut() {\r\n\t\tconst signOutPromises: Promise[] = [];\r\n\r\n\t\t// revoke the access token if it exists\r\n\t\tif (this.#tokenResponse) {\r\n\t\t\tconst tokenRevokeRequest = new RevokeTokenRequest({\r\n\t\t\t\ttoken: this.#tokenResponse.accessToken,\r\n\t\t\t\tclient_id: this.#clientId,\r\n\t\t\t\ttoken_type_hint: 'access_token',\r\n\t\t\t});\r\n\r\n\t\t\tsignOutPromises.push(this.#tokenHandler.performRevokeTokenRequest(this.#configuration, tokenRevokeRequest));\r\n\r\n\t\t\t// revoke the refresh token if it exists\r\n\t\t\tif (this.#tokenResponse.refreshToken) {\r\n\t\t\t\tconst refreshTokenRevokeRequest = new RevokeTokenRequest({\r\n\t\t\t\t\ttoken: this.#tokenResponse.refreshToken,\r\n\t\t\t\t\tclient_id: this.#clientId,\r\n\t\t\t\t\ttoken_type_hint: 'refresh_token',\r\n\t\t\t\t});\r\n\r\n\t\t\t\tsignOutPromises.push(\r\n\t\t\t\t\tthis.#tokenHandler.performRevokeTokenRequest(this.#configuration, refreshTokenRevokeRequest),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// clear the internal token state\r\n\t\tsignOutPromises.push(this.clearTokenStorage());\r\n\r\n\t\t// wait for all promises to settle before continuing\r\n\t\tawait Promise.allSettled(signOutPromises);\r\n\r\n\t\t// clear the session on the server as well\r\n\t\t// this will redirect the user to the end session endpoint of the server\r\n\t\t// which will redirect the user back to the client\r\n\t\t// and the client will then try and log in again (if the user is not logged in)\r\n\t\t// which will redirect the user to the login page\r\n\t\tconst postLogoutRedirectUri = new URL(this.#postLogoutRedirectUri, window.origin);\r\n\t\tconst endSessionEndpoint = this.#configuration.endSessionEndpoint;\r\n\t\tif (!endSessionEndpoint) {\r\n\t\t\tlocation.href = postLogoutRedirectUri.href;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst postLogoutLocation = new URL(endSessionEndpoint, this.#redirectUri);\r\n\t\tpostLogoutLocation.searchParams.set('post_logout_redirect_uri', postLogoutRedirectUri.href);\r\n\t\tlocation.href = postLogoutLocation.href;\r\n\t}\r\n\r\n\t/**\r\n\t * This method will check if the token needs to be refreshed and if so, it will refresh it and return the new access token.\r\n\t * If the token does not need to be refreshed, it will return the current access token.\r\n\t * @returns The access token for the user.\r\n\t */\r\n\tasync performWithFreshTokens(): Promise {\r\n\t\t// if the access token is valid, return it\r\n\t\tif (this.#tokenResponse?.isValid()) {\r\n\t\t\treturn Promise.resolve(this.#tokenResponse.accessToken);\r\n\t\t}\r\n\r\n\t\tconst success = await this.makeRefreshTokenRequest();\r\n\r\n\t\tif (!success) {\r\n\t\t\tthis.clearTokenStorage();\r\n\t\t\tthis.#timeoutSignal.next();\r\n\t\t\treturn Promise.reject('Missing tokenResponse.');\r\n\t\t}\r\n\r\n\t\treturn this.#tokenResponse\r\n\t\t\t? Promise.resolve(this.#tokenResponse.accessToken)\r\n\t\t\t: Promise.reject('Missing tokenResponse.');\r\n\t}\r\n\r\n\t/**\r\n\t * This method will link the current user to the specified provider by redirecting the user to the link endpoint.\r\n\t * @param provider The provider to link to.\r\n\t */\r\n\tasync linkLogin(provider: string): Promise {\r\n\t\tconst linkKey = await this.#makeLinkTokenRequest(provider);\r\n\r\n\t\tconst form = document.createElement('form');\r\n\t\tform.method = 'POST';\r\n\t\tform.action = this.#link_endpoint;\r\n\t\tform.style.display = 'none';\r\n\r\n\t\tconst providerInput = document.createElement('input');\r\n\t\tproviderInput.name = 'provider';\r\n\t\tproviderInput.value = provider;\r\n\t\tform.appendChild(providerInput);\r\n\r\n\t\tconst linkKeyInput = document.createElement('input');\r\n\t\tlinkKeyInput.name = 'linkKey';\r\n\t\tlinkKeyInput.value = linkKey;\r\n\t\tform.appendChild(linkKeyInput);\r\n\r\n\t\tdocument.body.appendChild(form);\r\n\t\tform.submit();\r\n\t}\r\n\r\n\t/**\r\n\t * This method will unlink the current user from the specified provider.\r\n\t * @param loginProvider\r\n\t * @param providerKey\r\n\t */\r\n\tasync unlinkLogin(loginProvider: string, providerKey: string): Promise {\r\n\t\tconst token = await this.performWithFreshTokens();\r\n\t\tconst request = new Request(this.#unlink_endpoint, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\theaders: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },\r\n\t\t\tbody: JSON.stringify({ loginProvider, providerKey }),\r\n\t\t});\r\n\r\n\t\tconst result = await fetch(request);\r\n\r\n\t\tif (!result.ok) {\r\n\t\t\tconst error = await result.json();\r\n\t\t\tthrow error;\r\n\t\t}\r\n\r\n\t\tawait this.signOut();\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Save the current token response to local storage.\r\n\t */\r\n\tasync #saveTokenState() {\r\n\t\tif (this.#tokenResponse) {\r\n\t\t\tawait this.#storageBackend.setItem(UMB_STORAGE_TOKEN_RESPONSE_NAME, JSON.stringify(this.#tokenResponse.toJson()));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * This method will make a token request to the server using the authorization code.\r\n\t * @param code\r\n\t * @param codeVerifier\r\n\t */\r\n\tasync #makeTokenRequest(code: string, codeVerifier: string | undefined): Promise {\r\n\t\tconst extras: StringMap = {};\r\n\r\n\t\tif (codeVerifier) {\r\n\t\t\textras.code_verifier = codeVerifier;\r\n\t\t}\r\n\r\n\t\t// use the code to make the token request.\r\n\t\tconst request = new TokenRequest({\r\n\t\t\tclient_id: this.#clientId,\r\n\t\t\tredirect_uri: this.#redirectUri,\r\n\t\t\tgrant_type: GRANT_TYPE_AUTHORIZATION_CODE,\r\n\t\t\tcode: code,\r\n\t\t\trefresh_token: undefined,\r\n\t\t\textras: extras,\r\n\t\t});\r\n\r\n\t\tawait this.#performTokenRequest(request);\r\n\t}\r\n\r\n\tasync makeRefreshTokenRequest(): Promise {\r\n\t\tif (!this.#tokenResponse?.refreshToken) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst request = new TokenRequest({\r\n\t\t\tclient_id: this.#clientId,\r\n\t\t\tredirect_uri: this.#redirectUri,\r\n\t\t\tgrant_type: GRANT_TYPE_REFRESH_TOKEN,\r\n\t\t\tcode: undefined,\r\n\t\t\trefresh_token: this.#tokenResponse.refreshToken,\r\n\t\t\textras: undefined,\r\n\t\t});\r\n\r\n\t\treturn this.#performTokenRequest(request);\r\n\t}\r\n\r\n\t/**\r\n\t * This method will make a token request to the server using the refresh token.\r\n\t * If the request fails, it will sign the user out (clear the token state).\r\n\t * @param request\r\n\t */\r\n\tasync #performTokenRequest(request: TokenRequest): Promise {\r\n\t\ttry {\r\n\t\t\tthis.#tokenResponse = await this.#tokenHandler.performTokenRequest(this.#configuration, request);\r\n\t\t\tthis.#saveTokenState();\r\n\t\t\treturn true;\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('Token request error', error);\r\n\t\t\tthis.clearTokenStorage();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tasync #makeLinkTokenRequest(provider: string) {\r\n\t\tconst token = await this.performWithFreshTokens();\r\n\r\n\t\tconst request = await fetch(`${this.#link_key_endpoint}?provider=${provider}`, {\r\n\t\t\theaders: {\r\n\t\t\t\tAuthorization: `Bearer ${token}`,\r\n\t\t\t\t'Content-Type': 'application/json',\r\n\t\t\t},\r\n\t\t});\r\n\r\n\t\tif (!request.ok) {\r\n\t\t\tthrow new Error('Failed to link login');\r\n\t\t}\r\n\r\n\t\treturn request.json();\r\n\t}\r\n}\r\n"],"names":["_UmbAuthProviderDefaultElement_instances","label_get","UmbAuthProviderDefaultElement","UmbLitElement","__privateAdd","html","__privateGet","nothing","label","labelLocalized","UmbTextStyles","css","__decorateClass","property","customElement","UMB_STORAGE_TOKEN_RESPONSE_NAME","requestor","FetchRequestor","UmbNoHashQueryStringUtils","BasicQueryStringUtils","input","UmbAuthFlow","openIdConnectUrl","redirectUri","postLogoutRedirectUri","timeoutSignal","clientId","scope","Subject","#redirectUri","#postLogoutRedirectUri","#timeoutSignal","#clientId","#scope","#configuration","AuthorizationServiceConfiguration","#link_endpoint","#link_key_endpoint","#unlink_endpoint","#notifier","AuthorizationNotifier","#tokenHandler","BaseTokenRequestHandler","#storageBackend","LocalStorageBackend","#authorizationHandler","RedirectRequestHandler","request","response","error","codeVerifier","#makeTokenRequest","#saveTokenState","#tokenResponse","tokenResponseJson","TokenResponse","identityProvider","usernameHint","extras","AuthorizationRequest","signOutPromises","tokenRevokeRequest","RevokeTokenRequest","refreshTokenRevokeRequest","endSessionEndpoint","postLogoutLocation","provider","linkKey","#makeLinkTokenRequest","form","providerInput","linkKeyInput","loginProvider","providerKey","token","result","code","TokenRequest","GRANT_TYPE_AUTHORIZATION_CODE","#performTokenRequest","GRANT_TYPE_REFRESH_TOKEN"],"mappings":";;;;;;;;;;;uQAAAA,GAAAC;AAOa,IAAAC,IAAN,cAA4CC,EAAqD;AAAA,EAAjG,cAAA;AAAA,UAAA,GAAA,SAAA,GAAAC,EAAA,MAAAJ,CAAA;AAAA,EAAA;AAAA,EAUG,oBAA0B;AAClC,UAAM,kBAAkB,GACnB,KAAA,aAAa,QAAQ,uBAAuB;AAAA,EAAA;AAAA,EASzC,SAAS;AACV,WAAAK;AAAA;AAAA;AAAA,aAGI,MAAM,KAAK,SAAS,KAAK,QAAQ,CAAC;AAAA;AAAA,aAElCC,QAAKN,GAAMC,CAAA,CAAA;AAAA,YACZ,KAAK,SAAS,MAAM,aAAa,QAAQ,SAAS;AAAA,aACjD,KAAK,SAAS,MAAM,aAAa,SAAS,SAAS;AAAA,MAC1D,KAAK,SAAS,MAAM,aAAa,OAChCI,8BAAiC,KAAK,SAAS,MAAM,aAAa,IAAI,iBACtEE,CAAO;AAAA,MACR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