keycloakify 10.0.4 → 10.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/account/i18n/i18n.d.ts +2 -2
- package/account/i18n/messages_defaultSet/ar.d.ts +0 -1
- package/account/i18n/messages_defaultSet/ar.js +1 -2
- package/account/i18n/messages_defaultSet/ar.js.map +1 -1
- package/account/i18n/messages_defaultSet/ca.d.ts +1 -230
- package/account/i18n/messages_defaultSet/ca.js +76 -305
- package/account/i18n/messages_defaultSet/ca.js.map +1 -1
- package/account/i18n/messages_defaultSet/cs.d.ts +0 -1
- package/account/i18n/messages_defaultSet/cs.js +0 -1
- package/account/i18n/messages_defaultSet/cs.js.map +1 -1
- package/account/i18n/messages_defaultSet/da.d.ts +0 -1
- package/account/i18n/messages_defaultSet/da.js +0 -1
- package/account/i18n/messages_defaultSet/da.js.map +1 -1
- package/account/i18n/messages_defaultSet/de.d.ts +1 -2
- package/account/i18n/messages_defaultSet/de.js +38 -39
- package/account/i18n/messages_defaultSet/de.js.map +1 -1
- package/account/i18n/messages_defaultSet/en.d.ts +0 -4
- package/account/i18n/messages_defaultSet/en.js +0 -4
- package/account/i18n/messages_defaultSet/en.js.map +1 -1
- package/account/i18n/messages_defaultSet/es.d.ts +0 -231
- package/account/i18n/messages_defaultSet/es.js +0 -231
- package/account/i18n/messages_defaultSet/es.js.map +1 -1
- package/account/i18n/messages_defaultSet/fi.d.ts +0 -1
- package/account/i18n/messages_defaultSet/fi.js +0 -1
- package/account/i18n/messages_defaultSet/fi.js.map +1 -1
- package/account/i18n/messages_defaultSet/fr.d.ts +0 -6
- package/account/i18n/messages_defaultSet/fr.js +1 -7
- package/account/i18n/messages_defaultSet/fr.js.map +1 -1
- package/account/i18n/messages_defaultSet/hu.d.ts +0 -69
- package/account/i18n/messages_defaultSet/hu.js +24 -93
- package/account/i18n/messages_defaultSet/hu.js.map +1 -1
- package/account/i18n/messages_defaultSet/index.d.ts +134 -428
- package/account/i18n/messages_defaultSet/index.js +0 -4
- package/account/i18n/messages_defaultSet/index.js.map +1 -1
- package/account/i18n/messages_defaultSet/it.d.ts +0 -6
- package/account/i18n/messages_defaultSet/it.js +0 -6
- package/account/i18n/messages_defaultSet/it.js.map +1 -1
- package/account/i18n/messages_defaultSet/ja.d.ts +0 -1
- package/account/i18n/messages_defaultSet/ja.js +0 -1
- package/account/i18n/messages_defaultSet/ja.js.map +1 -1
- package/account/i18n/messages_defaultSet/lt.d.ts +0 -1
- package/account/i18n/messages_defaultSet/lt.js +0 -1
- package/account/i18n/messages_defaultSet/lt.js.map +1 -1
- package/account/i18n/messages_defaultSet/lv.d.ts +0 -1
- package/account/i18n/messages_defaultSet/lv.js +0 -1
- package/account/i18n/messages_defaultSet/lv.js.map +1 -1
- package/account/i18n/messages_defaultSet/nl.d.ts +0 -1
- package/account/i18n/messages_defaultSet/nl.js +0 -1
- package/account/i18n/messages_defaultSet/nl.js.map +1 -1
- package/account/i18n/messages_defaultSet/no.d.ts +0 -1
- package/account/i18n/messages_defaultSet/no.js +0 -1
- package/account/i18n/messages_defaultSet/no.js.map +1 -1
- package/account/i18n/messages_defaultSet/pl.d.ts +0 -115
- package/account/i18n/messages_defaultSet/pl.js +0 -115
- package/account/i18n/messages_defaultSet/pl.js.map +1 -1
- package/account/i18n/messages_defaultSet/pt-BR.d.ts +0 -1
- package/account/i18n/messages_defaultSet/pt-BR.js +0 -1
- package/account/i18n/messages_defaultSet/pt-BR.js.map +1 -1
- package/account/i18n/messages_defaultSet/ru.d.ts +0 -1
- package/account/i18n/messages_defaultSet/ru.js +0 -1
- package/account/i18n/messages_defaultSet/ru.js.map +1 -1
- package/account/i18n/messages_defaultSet/sk.d.ts +0 -1
- package/account/i18n/messages_defaultSet/sk.js +0 -1
- package/account/i18n/messages_defaultSet/sk.js.map +1 -1
- package/account/i18n/messages_defaultSet/sv.d.ts +0 -1
- package/account/i18n/messages_defaultSet/sv.js +0 -1
- package/account/i18n/messages_defaultSet/sv.js.map +1 -1
- package/account/i18n/messages_defaultSet/tr.d.ts +1 -2
- package/account/i18n/messages_defaultSet/tr.js +1 -2
- package/account/i18n/messages_defaultSet/tr.js.map +1 -1
- package/account/i18n/messages_defaultSet/zh-CN.d.ts +0 -11
- package/account/i18n/messages_defaultSet/zh-CN.js +0 -11
- package/account/i18n/messages_defaultSet/zh-CN.js.map +1 -1
- package/account/i18n/useI18n.d.ts +2 -2
- package/bin/193.index.js +1 -1
- package/bin/31.index.js +6 -4
- package/bin/{622.index.js → 365.index.js} +76 -47
- package/bin/440.index.js +3 -20
- package/bin/932.index.js +1 -1
- package/bin/main.js +3 -3
- package/bin/shared/buildContext.js.map +1 -1
- package/bin/shared/constants.d.ts +2 -2
- package/bin/shared/constants.js +4 -2
- package/bin/shared/constants.js.map +1 -1
- package/login/DefaultPage.js +6 -0
- package/login/DefaultPage.js.map +1 -1
- package/login/KcContext/KcContext.d.ts +32 -1
- package/login/KcContext/KcContext.js.map +1 -1
- package/login/KcContext/getKcContextMock.d.ts +1 -1
- package/login/KcContext/kcContextMocks.d.ts +1 -1
- package/login/KcContext/kcContextMocks.js +5 -1
- package/login/KcContext/kcContextMocks.js.map +1 -1
- package/login/i18n/i18n.d.ts +2 -2
- package/login/i18n/messages_defaultSet/ca.d.ts +0 -23
- package/login/i18n/messages_defaultSet/ca.js +0 -23
- package/login/i18n/messages_defaultSet/ca.js.map +1 -1
- package/login/i18n/messages_defaultSet/cs.d.ts +1 -0
- package/login/i18n/messages_defaultSet/cs.js +16 -15
- package/login/i18n/messages_defaultSet/cs.js.map +1 -1
- package/login/i18n/messages_defaultSet/da.d.ts +0 -2
- package/login/i18n/messages_defaultSet/da.js +0 -2
- package/login/i18n/messages_defaultSet/da.js.map +1 -1
- package/login/i18n/messages_defaultSet/de.d.ts +83 -2
- package/login/i18n/messages_defaultSet/de.js +107 -26
- package/login/i18n/messages_defaultSet/de.js.map +1 -1
- package/login/i18n/messages_defaultSet/el.d.ts +0 -23
- package/login/i18n/messages_defaultSet/el.js +0 -23
- package/login/i18n/messages_defaultSet/el.js.map +1 -1
- package/login/i18n/messages_defaultSet/en.d.ts +19 -25
- package/login/i18n/messages_defaultSet/en.js +19 -25
- package/login/i18n/messages_defaultSet/en.js.map +1 -1
- package/login/i18n/messages_defaultSet/es.d.ts +0 -24
- package/login/i18n/messages_defaultSet/es.js +0 -24
- package/login/i18n/messages_defaultSet/es.js.map +1 -1
- package/login/i18n/messages_defaultSet/fa.d.ts +0 -23
- package/login/i18n/messages_defaultSet/fa.js +0 -23
- package/login/i18n/messages_defaultSet/fa.js.map +1 -1
- package/login/i18n/messages_defaultSet/hu.d.ts +0 -23
- package/login/i18n/messages_defaultSet/hu.js +0 -23
- package/login/i18n/messages_defaultSet/hu.js.map +1 -1
- package/login/i18n/messages_defaultSet/index.d.ts +96 -941
- package/login/i18n/messages_defaultSet/index.js +3 -0
- package/login/i18n/messages_defaultSet/index.js.map +1 -1
- package/login/i18n/messages_defaultSet/it.d.ts +0 -1
- package/login/i18n/messages_defaultSet/it.js +0 -1
- package/login/i18n/messages_defaultSet/it.js.map +1 -1
- package/login/i18n/messages_defaultSet/ka.d.ts +468 -0
- package/login/i18n/messages_defaultSet/ka.js +473 -0
- package/login/i18n/messages_defaultSet/ka.js.map +1 -0
- package/login/i18n/messages_defaultSet/pt-BR.d.ts +1 -0
- package/login/i18n/messages_defaultSet/pt-BR.js +3 -2
- package/login/i18n/messages_defaultSet/pt-BR.js.map +1 -1
- package/login/i18n/messages_defaultSet/pt.d.ts +448 -0
- package/login/i18n/messages_defaultSet/pt.js +453 -0
- package/login/i18n/messages_defaultSet/pt.js.map +1 -0
- package/login/i18n/messages_defaultSet/sk.d.ts +1 -0
- package/login/i18n/messages_defaultSet/sk.js +16 -15
- package/login/i18n/messages_defaultSet/sk.js.map +1 -1
- package/login/i18n/messages_defaultSet/zh-CN.d.ts +0 -24
- package/login/i18n/messages_defaultSet/zh-CN.js +0 -24
- package/login/i18n/messages_defaultSet/zh-CN.js.map +1 -1
- package/login/i18n/messages_defaultSet/zh-TW.d.ts +453 -0
- package/login/i18n/messages_defaultSet/zh-TW.js +458 -0
- package/login/i18n/messages_defaultSet/zh-TW.js.map +1 -0
- package/login/i18n/useI18n.d.ts +2 -2
- package/login/pages/Login.js +3 -3
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginIdpLinkConfirmOverride.d.ts +7 -0
- package/login/pages/LoginIdpLinkConfirmOverride.js +14 -0
- package/login/pages/LoginIdpLinkConfirmOverride.js.map +1 -0
- package/login/pages/LoginPasskeysConditionalAuthenticate.d.ts +7 -0
- package/login/pages/LoginPasskeysConditionalAuthenticate.js +80 -0
- package/login/pages/LoginPasskeysConditionalAuthenticate.js.map +1 -0
- package/login/pages/LoginUsername.js +3 -3
- package/login/pages/LoginUsername.js.map +1 -1
- package/package.json +28 -21
- package/src/account/i18n/messages_defaultSet/ar.ts +1 -2
- package/src/account/i18n/messages_defaultSet/ca.ts +76 -305
- package/src/account/i18n/messages_defaultSet/cs.ts +0 -1
- package/src/account/i18n/messages_defaultSet/da.ts +0 -1
- package/src/account/i18n/messages_defaultSet/de.ts +38 -39
- package/src/account/i18n/messages_defaultSet/en.ts +0 -4
- package/src/account/i18n/messages_defaultSet/es.ts +0 -231
- package/src/account/i18n/messages_defaultSet/fi.ts +0 -1
- package/src/account/i18n/messages_defaultSet/fr.ts +1 -7
- package/src/account/i18n/messages_defaultSet/hu.ts +24 -93
- package/src/account/i18n/messages_defaultSet/index.ts +0 -4
- package/src/account/i18n/messages_defaultSet/it.ts +0 -6
- package/src/account/i18n/messages_defaultSet/ja.ts +0 -1
- package/src/account/i18n/messages_defaultSet/lt.ts +0 -1
- package/src/account/i18n/messages_defaultSet/lv.ts +0 -1
- package/src/account/i18n/messages_defaultSet/nl.ts +0 -1
- package/src/account/i18n/messages_defaultSet/no.ts +0 -1
- package/src/account/i18n/messages_defaultSet/pl.ts +0 -115
- package/src/account/i18n/messages_defaultSet/pt-BR.ts +0 -1
- package/src/account/i18n/messages_defaultSet/ru.ts +0 -1
- package/src/account/i18n/messages_defaultSet/sk.ts +0 -1
- package/src/account/i18n/messages_defaultSet/sv.ts +0 -1
- package/src/account/i18n/messages_defaultSet/tr.ts +1 -2
- package/src/account/i18n/messages_defaultSet/zh-CN.ts +0 -11
- package/src/bin/keycloakify/buildJars/buildJar.ts +0 -19
- package/src/bin/shared/buildContext.ts +2 -2
- package/src/bin/shared/constants.ts +4 -2
- package/src/bin/shared/{downloadKeycloakDefaultTheme.ts → downloadKeycloakDefaultTheme/downloadKeycloakDefaultTheme.ts} +46 -6
- package/src/bin/shared/downloadKeycloakDefaultTheme/extra-assets/passkeysConditionalAuth.js +79 -0
- package/src/bin/shared/downloadKeycloakDefaultTheme/extra-assets/webauthnAuthenticate.js +82 -0
- package/src/bin/shared/downloadKeycloakDefaultTheme/index.ts +1 -0
- package/src/login/DefaultPage.tsx +6 -0
- package/src/login/KcContext/KcContext.ts +37 -1
- package/src/login/KcContext/kcContextMocks.ts +33 -0
- package/src/login/i18n/messages_defaultSet/ca.ts +0 -23
- package/src/login/i18n/messages_defaultSet/cs.ts +16 -15
- package/src/login/i18n/messages_defaultSet/da.ts +0 -2
- package/src/login/i18n/messages_defaultSet/de.ts +107 -26
- package/src/login/i18n/messages_defaultSet/el.ts +0 -23
- package/src/login/i18n/messages_defaultSet/en.ts +19 -25
- package/src/login/i18n/messages_defaultSet/es.ts +0 -24
- package/src/login/i18n/messages_defaultSet/fa.ts +0 -23
- package/src/login/i18n/messages_defaultSet/hu.ts +0 -23
- package/src/login/i18n/messages_defaultSet/index.ts +3 -0
- package/src/login/i18n/messages_defaultSet/it.ts +0 -1
- package/src/login/i18n/messages_defaultSet/ka.ts +474 -0
- package/src/login/i18n/messages_defaultSet/pt-BR.ts +3 -2
- package/src/login/i18n/messages_defaultSet/pt.ts +454 -0
- package/src/login/i18n/messages_defaultSet/sk.ts +16 -15
- package/src/login/i18n/messages_defaultSet/zh-CN.ts +0 -24
- package/src/login/i18n/messages_defaultSet/zh-TW.ts +459 -0
- package/src/login/pages/Login.tsx +1 -1
- package/src/login/pages/LoginIdpLinkConfirmOverride.tsx +40 -0
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.tsx +252 -0
- package/src/login/pages/LoginUsername.tsx +1 -1
- package/stories/login/pages/LoginIdpLinkConfirmOverride.stories.tsx +18 -0
- package/stories/login/pages/LoginPasskeysConditionalAuthenticate.stories.tsx +18 -0
- package/vite-plugin/index.js +46 -25
- package/account/i18n/messages_defaultSet/el.d.ts +0 -360
- package/account/i18n/messages_defaultSet/el.js +0 -365
- package/account/i18n/messages_defaultSet/el.js.map +0 -1
- package/account/i18n/messages_defaultSet/fa.d.ts +0 -361
- package/account/i18n/messages_defaultSet/fa.js +0 -366
- package/account/i18n/messages_defaultSet/fa.js.map +0 -1
- package/account/i18n/messages_defaultSet/th.d.ts +0 -339
- package/account/i18n/messages_defaultSet/th.js +0 -344
- package/account/i18n/messages_defaultSet/th.js.map +0 -1
- package/account/i18n/messages_defaultSet/uk.d.ts +0 -339
- package/account/i18n/messages_defaultSet/uk.js +0 -344
- package/account/i18n/messages_defaultSet/uk.js.map +0 -1
- package/bin/shared/downloadKeycloakDefaultTheme.d.ts +0 -11
- package/bin/shared/downloadKeycloakDefaultTheme.js.map +0 -1
- package/src/account/i18n/messages_defaultSet/el.ts +0 -366
- package/src/account/i18n/messages_defaultSet/fa.ts +0 -367
- package/src/account/i18n/messages_defaultSet/th.ts +0 -345
- package/src/account/i18n/messages_defaultSet/uk.ts +0 -345
@@ -0,0 +1,252 @@
|
|
1
|
+
import { useEffect, Fragment } from "react";
|
2
|
+
import { clsx } from "keycloakify/tools/clsx";
|
3
|
+
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
4
|
+
import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
|
5
|
+
import { getKcClsx } from "keycloakify/login/lib/kcClsx";
|
6
|
+
import { assert } from "keycloakify/tools/assert";
|
7
|
+
import type { KcContext } from "../KcContext";
|
8
|
+
import type { I18n } from "../i18n";
|
9
|
+
|
10
|
+
// NOTE: From Keycloak 25.0.4
|
11
|
+
export default function LoginPasskeysConditionalAuthenticate(
|
12
|
+
props: PageProps<Extract<KcContext, { pageId: "login-passkeys-conditional-authenticate.ftl" }>, I18n>
|
13
|
+
) {
|
14
|
+
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
15
|
+
|
16
|
+
const {
|
17
|
+
messagesPerField,
|
18
|
+
login,
|
19
|
+
url,
|
20
|
+
usernameHidden,
|
21
|
+
shouldDisplayAuthenticators,
|
22
|
+
authenticators,
|
23
|
+
registrationDisabled,
|
24
|
+
realm,
|
25
|
+
isUserIdentified,
|
26
|
+
challenge,
|
27
|
+
userVerification,
|
28
|
+
rpId,
|
29
|
+
createTimeout
|
30
|
+
} = kcContext;
|
31
|
+
|
32
|
+
const { msg, msgStr, advancedMsg } = i18n;
|
33
|
+
|
34
|
+
const { kcClsx } = getKcClsx({
|
35
|
+
doUseDefaultCss,
|
36
|
+
classes
|
37
|
+
});
|
38
|
+
|
39
|
+
const { insertScriptTags } = useInsertScriptTags({
|
40
|
+
componentOrHookName: "LoginRecoveryAuthnCodeConfig",
|
41
|
+
scriptTags: [
|
42
|
+
{
|
43
|
+
type: "module",
|
44
|
+
textContent: `
|
45
|
+
import { authenticateByWebAuthn } from "${url.resourcesPath}/js/webauthnAuthenticate.js";
|
46
|
+
import { initAuthenticate } from "${url.resourcesPath}/js/passkeysConditionalAuth.js";
|
47
|
+
|
48
|
+
const authButton = document.getElementById('authenticateWebAuthnButton');
|
49
|
+
const input = {
|
50
|
+
isUserIdentified : ${isUserIdentified},
|
51
|
+
challenge : '${challenge}',
|
52
|
+
userVerification : '${userVerification}',
|
53
|
+
rpId : '${rpId}',
|
54
|
+
createTimeout : ${createTimeout},
|
55
|
+
errmsg : "${msgStr("webauthn-unsupported-browser-text")}"
|
56
|
+
};
|
57
|
+
authButton.addEventListener("click", () => {
|
58
|
+
authenticateByWebAuthn(input);
|
59
|
+
});
|
60
|
+
|
61
|
+
const args = {
|
62
|
+
isUserIdentified : ${isUserIdentified},
|
63
|
+
challenge : '${challenge}',
|
64
|
+
userVerification : '${userVerification}',
|
65
|
+
rpId : '${rpId}',
|
66
|
+
createTimeout : ${createTimeout},
|
67
|
+
errmsg : "${msgStr("passkey-unsupported-browser-text")}"
|
68
|
+
};
|
69
|
+
|
70
|
+
document.addEventListener("DOMContentLoaded", (event) => initAuthenticate(args));
|
71
|
+
`
|
72
|
+
}
|
73
|
+
]
|
74
|
+
});
|
75
|
+
|
76
|
+
useEffect(() => {
|
77
|
+
insertScriptTags();
|
78
|
+
}, []);
|
79
|
+
|
80
|
+
return (
|
81
|
+
<Template
|
82
|
+
kcContext={kcContext}
|
83
|
+
i18n={i18n}
|
84
|
+
doUseDefaultCss={doUseDefaultCss}
|
85
|
+
classes={classes}
|
86
|
+
headerNode={msg("passkey-login-title")}
|
87
|
+
infoNode={
|
88
|
+
realm.registrationAllowed &&
|
89
|
+
!registrationDisabled && (
|
90
|
+
<div id="kc-registration">
|
91
|
+
<span>
|
92
|
+
${msg("noAccount")}{" "}
|
93
|
+
<a tabIndex={6} href={url.registrationUrl}>
|
94
|
+
{msg("doRegister")}
|
95
|
+
</a>
|
96
|
+
</span>
|
97
|
+
</div>
|
98
|
+
)
|
99
|
+
}
|
100
|
+
>
|
101
|
+
<form id="webauth" action={url.loginAction} method="post">
|
102
|
+
<input type="hidden" id="clientDataJSON" name="clientDataJSON" />
|
103
|
+
<input type="hidden" id="authenticatorData" name="authenticatorData" />
|
104
|
+
<input type="hidden" id="signature" name="signature" />
|
105
|
+
<input type="hidden" id="credentialId" name="credentialId" />
|
106
|
+
<input type="hidden" id="userHandle" name="userHandle" />
|
107
|
+
<input type="hidden" id="error" name="error" />
|
108
|
+
</form>
|
109
|
+
|
110
|
+
<div className={kcClsx("kcFormGroupClass")} no-bottom-margin="true" style={{ marginBottom: 0 }}>
|
111
|
+
{authenticators !== undefined && Object.keys(authenticators).length !== 0 && (
|
112
|
+
<>
|
113
|
+
<form id="authn_select" className={kcClsx("kcFormClass")}>
|
114
|
+
{authenticators.authenticators.map((authenticator, i) => (
|
115
|
+
<input key={i} type="hidden" name="authn_use_chk" readOnly value={authenticator.credentialId} />
|
116
|
+
))}
|
117
|
+
</form>
|
118
|
+
{shouldDisplayAuthenticators && (
|
119
|
+
<>
|
120
|
+
{authenticators.authenticators.length > 1 && (
|
121
|
+
<p className={kcClsx("kcSelectAuthListItemTitle")}>{msg("passkey-available-authenticators")}</p>
|
122
|
+
)}
|
123
|
+
<div className={kcClsx("kcFormClass")}>
|
124
|
+
{authenticators.authenticators.map((authenticator, i) => (
|
125
|
+
<div key={i} id={`kc-webauthn-authenticator-item-${i}`} className={kcClsx("kcSelectAuthListItemClass")}>
|
126
|
+
<i
|
127
|
+
className={clsx(
|
128
|
+
(() => {
|
129
|
+
const className = kcClsx(authenticator.transports.iconClass as any);
|
130
|
+
if (className === authenticator.transports.iconClass) {
|
131
|
+
return kcClsx("kcWebAuthnDefaultIcon");
|
132
|
+
}
|
133
|
+
return className;
|
134
|
+
})(),
|
135
|
+
kcClsx("kcSelectAuthListItemIconPropertyClass")
|
136
|
+
)}
|
137
|
+
/>
|
138
|
+
<div className={kcClsx("kcSelectAuthListItemBodyClass")}>
|
139
|
+
<div
|
140
|
+
id={`kc-webauthn-authenticator-label-${i}`}
|
141
|
+
className={kcClsx("kcSelectAuthListItemHeadingClass")}
|
142
|
+
>
|
143
|
+
{advancedMsg(authenticator.label)}
|
144
|
+
</div>
|
145
|
+
{authenticator.transports !== undefined &&
|
146
|
+
authenticator.transports.displayNameProperties !== undefined &&
|
147
|
+
authenticator.transports.displayNameProperties.length !== 0 && (
|
148
|
+
<div
|
149
|
+
id={`kc-webauthn-authenticator-transport-${i}`}
|
150
|
+
className={kcClsx("kcSelectAuthListItemDescriptionClass")}
|
151
|
+
>
|
152
|
+
{authenticator.transports.displayNameProperties.map((nameProperty, i, arr) => (
|
153
|
+
<Fragment key={i}>
|
154
|
+
<span key={i}> {advancedMsg(nameProperty)} </span>
|
155
|
+
{i !== arr.length - 1 && <span>, </span>}
|
156
|
+
</Fragment>
|
157
|
+
))}
|
158
|
+
</div>
|
159
|
+
)}
|
160
|
+
<div className={kcClsx("kcSelectAuthListItemDescriptionClass")}>
|
161
|
+
<span id={`kc-webauthn-authenticator-createdlabel-${i}`}>{msg("passkey-createdAt-label")}</span>
|
162
|
+
<span id={`kc-webauthn-authenticator-created-${i}`}>{authenticator.createdAt}</span>
|
163
|
+
</div>
|
164
|
+
</div>
|
165
|
+
<div className={kcClsx("kcSelectAuthListItemFillClass")} />
|
166
|
+
</div>
|
167
|
+
))}
|
168
|
+
</div>
|
169
|
+
</>
|
170
|
+
)}
|
171
|
+
<div id="kc-form">
|
172
|
+
<div id="kc-form-wrapper">
|
173
|
+
{realm.password && (
|
174
|
+
<form
|
175
|
+
id="kc-form-passkey"
|
176
|
+
action={url.loginAction}
|
177
|
+
method="post"
|
178
|
+
style={{ display: "none" }}
|
179
|
+
onSubmit={event => {
|
180
|
+
try {
|
181
|
+
// @ts-expect-error
|
182
|
+
event.target.login.disabled = true;
|
183
|
+
} catch {}
|
184
|
+
|
185
|
+
return true;
|
186
|
+
}}
|
187
|
+
>
|
188
|
+
{!usernameHidden && (
|
189
|
+
<div className={kcClsx("kcFormGroupClass")}>
|
190
|
+
<label htmlFor="username" className={kcClsx("kcLabelClass")}>
|
191
|
+
{msg("passkey-autofill-select")}
|
192
|
+
</label>
|
193
|
+
<input
|
194
|
+
tabIndex={1}
|
195
|
+
id="username"
|
196
|
+
aria-invalid={messagesPerField.existsError("username")}
|
197
|
+
className={kcClsx("kcInputClass")}
|
198
|
+
name="username"
|
199
|
+
defaultValue={login.username ?? ""}
|
200
|
+
//autoComplete="username webauthn"
|
201
|
+
type="text"
|
202
|
+
autoFocus
|
203
|
+
autoComplete="off"
|
204
|
+
/>
|
205
|
+
{messagesPerField.existsError("username") && (
|
206
|
+
<span id="input-error-username" className={kcClsx("kcInputErrorMessageClass")} aria-live="polite">
|
207
|
+
{messagesPerField.get("username")}
|
208
|
+
</span>
|
209
|
+
)}
|
210
|
+
</div>
|
211
|
+
)}
|
212
|
+
</form>
|
213
|
+
)}
|
214
|
+
<div id="kc-form-passkey-button" className={kcClsx("kcFormButtonsClass")} style={{ display: "none" }}>
|
215
|
+
<input
|
216
|
+
id="authenticateWebAuthnButton"
|
217
|
+
type="button"
|
218
|
+
onClick={() => {
|
219
|
+
assert("doAuthenticate" in window);
|
220
|
+
assert(typeof window.doAuthenticate === "function");
|
221
|
+
window.doAuthenticate(
|
222
|
+
[],
|
223
|
+
rpId,
|
224
|
+
challenge,
|
225
|
+
typeof isUserIdentified === "boolean" ? isUserIdentified : isUserIdentified === "true",
|
226
|
+
createTimeout,
|
227
|
+
userVerification,
|
228
|
+
msgStr("passkey-unsupported-browser-text")
|
229
|
+
);
|
230
|
+
}}
|
231
|
+
autoFocus
|
232
|
+
value={msgStr("passkey-doAuthenticate")}
|
233
|
+
className={kcClsx("kcButtonClass", "kcButtonPrimaryClass", "kcButtonBlockClass", "kcButtonLargeClass")}
|
234
|
+
/>
|
235
|
+
</div>
|
236
|
+
<div id="kc-form-passkey-button" className={kcClsx("kcFormButtonsClass")} style={{ display: "none" }}>
|
237
|
+
<input
|
238
|
+
id="authenticateWebAuthnButton"
|
239
|
+
type="button"
|
240
|
+
autoFocus
|
241
|
+
value={msgStr("passkey-doAuthenticate")}
|
242
|
+
className={kcClsx("kcButtonClass", "kcButtonPrimaryClass", "kcButtonBlockClass", "kcButtonLargeClass")}
|
243
|
+
/>
|
244
|
+
</div>
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
</>
|
248
|
+
)}
|
249
|
+
</div>
|
250
|
+
</Template>
|
251
|
+
);
|
252
|
+
}
|
@@ -40,7 +40,7 @@ export default function LoginUsername(props: PageProps<Extract<KcContext, { page
|
|
40
40
|
headerNode={msg("doLogIn")}
|
41
41
|
socialProvidersNode={
|
42
42
|
<>
|
43
|
-
{realm.password && social.providers
|
43
|
+
{realm.password && social.providers !== undefined && social.providers.length !== 0 && (
|
44
44
|
<div id="kc-social-providers" className={kcClsx("kcFormSocialAccountSectionClass")}>
|
45
45
|
<hr />
|
46
46
|
<h2>{msg("identity-provider-login-label")}</h2>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
3
|
+
import { createKcPageStory } from "../KcPageStory";
|
4
|
+
|
5
|
+
const { KcPageStory } = createKcPageStory({ pageId: "login-idp-link-confirm-override.ftl" });
|
6
|
+
|
7
|
+
const meta = {
|
8
|
+
title: "login/login-idp-link-confirm-override.ftl",
|
9
|
+
component: KcPageStory
|
10
|
+
} satisfies Meta<typeof KcPageStory>;
|
11
|
+
|
12
|
+
export default meta;
|
13
|
+
|
14
|
+
type Story = StoryObj<typeof meta>;
|
15
|
+
|
16
|
+
export const Default: Story = {
|
17
|
+
render: () => <KcPageStory />
|
18
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
3
|
+
import { createKcPageStory } from "../KcPageStory";
|
4
|
+
|
5
|
+
const { KcPageStory } = createKcPageStory({ pageId: "login-passkeys-conditional-authenticate.ftl" });
|
6
|
+
|
7
|
+
const meta = {
|
8
|
+
title: "login/login-passkeys-conditional-authenticate.ftl",
|
9
|
+
component: KcPageStory
|
10
|
+
} satisfies Meta<typeof KcPageStory>;
|
11
|
+
|
12
|
+
export default meta;
|
13
|
+
|
14
|
+
type Story = StoryObj<typeof meta>;
|
15
|
+
|
16
|
+
export const Default: Story = {
|
17
|
+
render: () => <KcPageStory />
|
18
|
+
};
|
package/vite-plugin/index.js
CHANGED
@@ -431,7 +431,7 @@ function getBuildContext(params) {
|
|
431
431
|
.host) === null || _c === void 0 ? void 0 : _c.replace(/:[0-9]+$/, "")) === null || _d === void 0 ? void 0 : _d.split(".").reverse().join(".")) !== null && _e !== void 0 ? _e : fallbackGroupId) + ".keycloak");
|
432
432
|
})(),
|
433
433
|
artifactId: (_d = (_c = process.env.KEYCLOAKIFY_ARTIFACT_ID) !== null && _c !== void 0 ? _c : buildOptions.artifactId) !== null && _d !== void 0 ? _d : `${themeNames[0]}-keycloak-theme`,
|
434
|
-
loginThemeResourcesFromKeycloakVersion: (_e = buildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _e !== void 0 ? _e : constants.
|
434
|
+
loginThemeResourcesFromKeycloakVersion: (_e = buildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _e !== void 0 ? _e : constants.LOGIN_THEME_RESOURCES_FROM_KEYCLOAK_VERSION_DEFAULT,
|
435
435
|
projectDirPath,
|
436
436
|
projectBuildDirPath,
|
437
437
|
keycloakifyBuildDirPath: (() => {
|
@@ -746,7 +746,7 @@ __nccwpck_require__.r(__webpack_exports__);
|
|
746
746
|
/* harmony export */ "KEYCLOAK_RESOURCES": () => (/* binding */ KEYCLOAK_RESOURCES),
|
747
747
|
/* harmony export */ "LAST_KEYCLOAK_VERSION_WITH_ACCOUNT_V1": () => (/* binding */ LAST_KEYCLOAK_VERSION_WITH_ACCOUNT_V1),
|
748
748
|
/* harmony export */ "LOGIN_THEME_PAGE_IDS": () => (/* binding */ LOGIN_THEME_PAGE_IDS),
|
749
|
-
/* harmony export */ "
|
749
|
+
/* harmony export */ "LOGIN_THEME_RESOURCES_FROM_KEYCLOAK_VERSION_DEFAULT": () => (/* binding */ LOGIN_THEME_RESOURCES_FROM_KEYCLOAK_VERSION_DEFAULT),
|
750
750
|
/* harmony export */ "RESOURCES_COMMON": () => (/* binding */ RESOURCES_COMMON),
|
751
751
|
/* harmony export */ "THEME_TYPES": () => (/* binding */ THEME_TYPES),
|
752
752
|
/* harmony export */ "VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES": () => (/* binding */ VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES)
|
@@ -796,7 +796,9 @@ const LOGIN_THEME_PAGE_IDS = [
|
|
796
796
|
"login-recovery-authn-code-input.ftl",
|
797
797
|
"login-reset-otp.ftl",
|
798
798
|
"login-x509-info.ftl",
|
799
|
-
"webauthn-error.ftl"
|
799
|
+
"webauthn-error.ftl",
|
800
|
+
"login-passkeys-conditional-authenticate.ftl",
|
801
|
+
"login-idp-link-confirm-override.ftl"
|
800
802
|
];
|
801
803
|
const ACCOUNT_THEME_PAGE_IDS = [
|
802
804
|
"password.ftl",
|
@@ -809,12 +811,12 @@ const ACCOUNT_THEME_PAGE_IDS = [
|
|
809
811
|
];
|
810
812
|
const CONTAINER_NAME = "keycloak-keycloakify";
|
811
813
|
const FALLBACK_LANGUAGE_TAG = "en";
|
812
|
-
const
|
814
|
+
const LOGIN_THEME_RESOURCES_FROM_KEYCLOAK_VERSION_DEFAULT = "24.0.4";
|
813
815
|
//# sourceMappingURL=constants.js.map
|
814
816
|
|
815
817
|
/***/ }),
|
816
818
|
|
817
|
-
/***/
|
819
|
+
/***/ 4348:
|
818
820
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
819
821
|
|
820
822
|
"use strict";
|
@@ -1197,7 +1199,26 @@ var SuccessTracker;
|
|
1197
1199
|
SuccessTracker.removeFromExtracted = removeFromExtracted;
|
1198
1200
|
})(SuccessTracker || (SuccessTracker = {}));
|
1199
1201
|
//# sourceMappingURL=downloadAndExtractArchive.js.map
|
1200
|
-
;// CONCATENATED MODULE: ./dist/bin/
|
1202
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/getThisCodebaseRootDirPath.js
|
1203
|
+
|
1204
|
+
|
1205
|
+
function getThisCodebaseRootDirPath_rec(dirPath) {
|
1206
|
+
if (external_fs_.existsSync(external_path_.join(dirPath, "package.json"))) {
|
1207
|
+
return dirPath;
|
1208
|
+
}
|
1209
|
+
return getThisCodebaseRootDirPath_rec(external_path_.join(dirPath, ".."));
|
1210
|
+
}
|
1211
|
+
let result = undefined;
|
1212
|
+
function getThisCodebaseRootDirPath() {
|
1213
|
+
if (result !== undefined) {
|
1214
|
+
return result;
|
1215
|
+
}
|
1216
|
+
return (result = getThisCodebaseRootDirPath_rec(__dirname));
|
1217
|
+
}
|
1218
|
+
//# sourceMappingURL=getThisCodebaseRootDirPath.js.map
|
1219
|
+
;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme/downloadKeycloakDefaultTheme.js
|
1220
|
+
|
1221
|
+
|
1201
1222
|
|
1202
1223
|
|
1203
1224
|
|
@@ -1207,6 +1228,7 @@ async function downloadKeycloakDefaultTheme(params) {
|
|
1207
1228
|
const { keycloakVersion, buildContext } = params;
|
1208
1229
|
let kcNodeModulesKeepFilePaths = undefined;
|
1209
1230
|
let kcNodeModulesKeepFilePaths_lastAccountV1 = undefined;
|
1231
|
+
let areExtraAssetsFor24Copied = false;
|
1210
1232
|
const { extractedDirPath } = await downloadAndExtractArchive({
|
1211
1233
|
url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
|
1212
1234
|
cacheDirPath: buildContext.cacheDirPath,
|
@@ -1217,13 +1239,13 @@ async function downloadKeycloakDefaultTheme(params) {
|
|
1217
1239
|
if (fileRelativePath.startsWith("..")) {
|
1218
1240
|
return;
|
1219
1241
|
}
|
1220
|
-
const { readFile, writeFile } = params;
|
1221
1242
|
skip_keycloak_v2: {
|
1222
1243
|
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak.v2"))) {
|
1223
1244
|
break skip_keycloak_v2;
|
1224
1245
|
}
|
1225
1246
|
return;
|
1226
1247
|
}
|
1248
|
+
const { readFile, writeFile } = params;
|
1227
1249
|
last_account_v1_transformations: {
|
1228
1250
|
if (constants.LAST_KEYCLOAK_VERSION_WITH_ACCOUNT_V1 !== keycloakVersion) {
|
1229
1251
|
break last_account_v1_transformations;
|
@@ -1277,6 +1299,19 @@ async function downloadKeycloakDefaultTheme(params) {
|
|
1277
1299
|
return;
|
1278
1300
|
}
|
1279
1301
|
}
|
1302
|
+
copy_extra_assets: {
|
1303
|
+
if (keycloakVersion !== "24.0.4") {
|
1304
|
+
break copy_extra_assets;
|
1305
|
+
}
|
1306
|
+
if (areExtraAssetsFor24Copied) {
|
1307
|
+
break copy_extra_assets;
|
1308
|
+
}
|
1309
|
+
const extraAssetsDirPath = (0,external_path_.join)(getThisCodebaseRootDirPath(), "src", "bin", __dirname.split(`${external_path_.sep}bin${external_path_.sep}`)[1], "extra-assets");
|
1310
|
+
await Promise.all(["webauthnAuthenticate.js", "passkeysConditionalAuth.js"].map(async (fileBasename) => writeFile({
|
1311
|
+
fileRelativePath: (0,external_path_.join)("base", "login", "resources", "js", fileBasename),
|
1312
|
+
modifiedData: await promises_.readFile((0,external_path_.join)(extraAssetsDirPath, fileBasename))
|
1313
|
+
})));
|
1314
|
+
}
|
1280
1315
|
skip_unused_resources: {
|
1281
1316
|
if (keycloakVersion !== "24.0.4") {
|
1282
1317
|
break skip_unused_resources;
|
@@ -1330,6 +1365,9 @@ async function downloadKeycloakDefaultTheme(params) {
|
|
1330
1365
|
return { defaultThemeDirPath: extractedDirPath };
|
1331
1366
|
}
|
1332
1367
|
//# sourceMappingURL=downloadKeycloakDefaultTheme.js.map
|
1368
|
+
;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme/index.js
|
1369
|
+
|
1370
|
+
//# sourceMappingURL=index.js.map
|
1333
1371
|
;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakStaticResources.js
|
1334
1372
|
|
1335
1373
|
|
@@ -1365,23 +1403,6 @@ async function downloadKeycloakStaticResources(params) {
|
|
1365
1403
|
});
|
1366
1404
|
}
|
1367
1405
|
//# sourceMappingURL=downloadKeycloakStaticResources.js.map
|
1368
|
-
;// CONCATENATED MODULE: ./dist/bin/tools/getThisCodebaseRootDirPath.js
|
1369
|
-
|
1370
|
-
|
1371
|
-
function getThisCodebaseRootDirPath_rec(dirPath) {
|
1372
|
-
if (external_fs_.existsSync(external_path_.join(dirPath, "package.json"))) {
|
1373
|
-
return dirPath;
|
1374
|
-
}
|
1375
|
-
return getThisCodebaseRootDirPath_rec(external_path_.join(dirPath, ".."));
|
1376
|
-
}
|
1377
|
-
let result = undefined;
|
1378
|
-
function getThisCodebaseRootDirPath() {
|
1379
|
-
if (result !== undefined) {
|
1380
|
-
return result;
|
1381
|
-
}
|
1382
|
-
return (result = getThisCodebaseRootDirPath_rec(__dirname));
|
1383
|
-
}
|
1384
|
-
//# sourceMappingURL=getThisCodebaseRootDirPath.js.map
|
1385
1406
|
;// CONCATENATED MODULE: ./dist/bin/tools/readThisNpmPackageVersion.js
|
1386
1407
|
|
1387
1408
|
|
@@ -1833,7 +1854,7 @@ const path_1 = __nccwpck_require__(1017);
|
|
1833
1854
|
const constants_1 = __nccwpck_require__(173);
|
1834
1855
|
const id_1 = __nccwpck_require__(3047);
|
1835
1856
|
const fs_rm_1 = __nccwpck_require__(8699);
|
1836
|
-
const copyKeycloakResourcesToPublic_1 = __nccwpck_require__(
|
1857
|
+
const copyKeycloakResourcesToPublic_1 = __nccwpck_require__(4348);
|
1837
1858
|
const assert_1 = __nccwpck_require__(8078);
|
1838
1859
|
const buildContext_1 = __nccwpck_require__(5614);
|
1839
1860
|
const magic_string_1 = __importDefault(__nccwpck_require__(5734));
|