keycloak_theme/1600.72689485.iframe.bundle.js

1 line
12 KiB
JavaScript
Raw Normal View History

2024-06-19 02:01:09 +00:00
"use strict";(self.webpackChunkkeycloakify=self.webpackChunkkeycloakify||[]).push([[1600],{"./dist/login/pages/WebauthnAuthenticate.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>WebauthnAuthenticate});__webpack_require__("./node_modules/core-js/modules/es.object.assign.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js"),react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/index.js"),tsafe_assert__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/tsafe/assert.js"),_tools_clsx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./dist/tools/clsx.js"),_tools_useInsertScriptTags__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./dist/tools/useInsertScriptTags.js"),_login_lib_kcClsx__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./dist/login/lib/kcClsx.js");function WebauthnAuthenticate(props){var kcContext=props.kcContext,i18n=props.i18n,doUseDefaultCss=props.doUseDefaultCss,Template=props.Template,classes=props.classes,kcClsx=(0,_login_lib_kcClsx__WEBPACK_IMPORTED_MODULE_7__.$)({doUseDefaultCss,classes}).kcClsx,url=kcContext.url,isUserIdentified=kcContext.isUserIdentified,challenge=kcContext.challenge,userVerification=kcContext.userVerification,rpId=kcContext.rpId,createTimeout=kcContext.createTimeout,messagesPerField=kcContext.messagesPerField,realm=kcContext.realm,registrationDisabled=kcContext.registrationDisabled,authenticators=kcContext.authenticators,shouldDisplayAuthenticators=kcContext.shouldDisplayAuthenticators,msg=i18n.msg,msgStr=i18n.msgStr,advancedMsg=i18n.advancedMsg,insertScriptTags=(0,_tools_useInsertScriptTags__WEBPACK_IMPORTED_MODULE_6__.m)({componentOrHookName:"WebauthnAuthenticate",scriptTags:[{type:"text/javascript",src:url.resourcesCommonPath+"/node_modules/jquery/dist/jquery.min.js"},{type:"text/javascript",src:url.resourcesPath+"/js/base64url.js"},{type:"text/javascript",textContent:"\n\n function webAuthnAuthenticate() {\n let isUserIdentified = "+isUserIdentified+";\n if (!isUserIdentified) {\n doAuthenticate([]);\n return;\n }\n checkAllowCredentials();\n }\n\n function checkAllowCredentials() {\n let allowCredentials = [];\n let authn_use = document.forms['authn_select'].authn_use_chk;\n \n if (authn_use !== undefined) {\n if (authn_use.length === undefined) {\n allowCredentials.push({\n id: base64url.decode(authn_use.value, {loose: true}),\n type: 'public-key',\n });\n } else {\n for (let i = 0; i < authn_use.length; i++) {\n allowCredentials.push({\n id: base64url.decode(authn_use[i].value, {loose: true}),\n type: 'public-key',\n });\n }\n }\n }\n doAuthenticate(allowCredentials);\n }\n\n\n function doAuthenticate(allowCredentials) {\n \n // Check if WebAuthn is supported by this browser\n if (!window.PublicKeyCredential) {\n $(\"#error\").val(\""+msgStr("webauthn-unsupported-browser-text")+'");\n $("#webauth").submit();\n return;\n }\n