keycloakify 10.1.0-rc.0 → 10.1.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/PUBLIC_URL.js +2 -2
- package/PUBLIC_URL.js.map +1 -1
- package/account/KcContext/kcContextMocks.js +3 -3
- package/account/KcContext/kcContextMocks.js.map +1 -1
- package/bin/193.index.js +198 -62
- package/bin/{365.index.js → 20.index.js} +302 -263
- package/bin/31.index.js +15 -23
- package/bin/{430.index.js → 33.index.js} +579 -4
- package/bin/{678.index.js → 36.index.js} +2 -577
- package/bin/{440.index.js → 499.index.js} +259 -181
- package/bin/526.index.js +3 -784
- package/bin/599.index.js +4 -1
- package/bin/780.index.js +1 -1
- package/bin/{525.index.js → 903.index.js} +4840 -97
- package/bin/932.index.js +115 -886
- package/bin/main.js +4 -4
- package/bin/shared/buildContext.d.ts +0 -2
- package/bin/shared/buildContext.js.map +1 -1
- package/bin/shared/constants.d.ts +5 -6
- package/bin/shared/constants.js +5 -6
- package/bin/shared/constants.js.map +1 -1
- package/bin/shared/copyKeycloakResourcesToPublic.d.ts +2 -4
- package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -1
- package/login/KcContext/KcContext.d.ts +9 -18
- package/login/KcContext/KcContext.js.map +1 -1
- package/login/KcContext/kcContextMocks.js +6 -10
- package/login/KcContext/kcContextMocks.js.map +1 -1
- package/login/Template.js +4 -59
- package/login/Template.js.map +1 -1
- package/login/Template.useStylesAndScripts.d.ts +17 -0
- package/login/Template.useStylesAndScripts.js +69 -0
- package/login/Template.useStylesAndScripts.js.map +1 -0
- package/login/pages/Login.js +1 -1
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginIdpLinkConfirmOverride.js +0 -1
- package/login/pages/LoginIdpLinkConfirmOverride.js.map +1 -1
- package/login/pages/LoginPasskeysConditionalAuthenticate.js +6 -49
- package/login/pages/LoginPasskeysConditionalAuthenticate.js.map +1 -1
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.d.ts +20 -0
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js +49 -0
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js.map +1 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.js +4 -126
- package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.d.ts +9 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js +133 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js.map +1 -0
- package/login/pages/LoginUsername.js +1 -1
- package/login/pages/LoginUsername.js.map +1 -1
- package/login/pages/Register.js +6 -3
- package/login/pages/Register.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.js +13 -116
- package/login/pages/WebauthnAuthenticate.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.useScript.d.ts +21 -0
- package/login/pages/WebauthnAuthenticate.useScript.js +41 -0
- package/login/pages/WebauthnAuthenticate.useScript.js.map +1 -0
- package/login/pages/WebauthnRegister.js +8 -178
- package/login/pages/WebauthnRegister.js.map +1 -1
- package/login/pages/WebauthnRegister.useScript.d.ts +27 -0
- package/login/pages/WebauthnRegister.useScript.js +49 -0
- package/login/pages/WebauthnRegister.useScript.js.map +1 -0
- package/package.json +125 -15
- package/res/account-v1/account.ftl +70 -0
- package/res/account-v1/applications.ftl +76 -0
- package/res/account-v1/federatedIdentity.ftl +42 -0
- package/res/account-v1/log.ftl +35 -0
- package/res/account-v1/messages/messages_ar.properties +406 -0
- package/res/account-v1/messages/messages_ca.properties +147 -0
- package/res/account-v1/messages/messages_cs.properties +171 -0
- package/res/account-v1/messages/messages_da.properties +339 -0
- package/res/account-v1/messages/messages_de.properties +353 -0
- package/res/account-v1/messages/messages_en.properties +404 -0
- package/res/account-v1/messages/messages_es.properties +147 -0
- package/res/account-v1/messages/messages_fi.properties +400 -0
- package/res/account-v1/messages/messages_fr.properties +180 -0
- package/res/account-v1/messages/messages_hu.properties +334 -0
- package/res/account-v1/messages/messages_it.properties +336 -0
- package/res/account-v1/messages/messages_ja.properties +335 -0
- package/res/account-v1/messages/messages_lt.properties +154 -0
- package/res/account-v1/messages/messages_lv.properties +197 -0
- package/res/account-v1/messages/messages_nl.properties +371 -0
- package/res/account-v1/messages/messages_no.properties +152 -0
- package/res/account-v1/messages/messages_pl.properties +248 -0
- package/res/account-v1/messages/messages_pt_BR.properties +349 -0
- package/res/account-v1/messages/messages_ru.properties +235 -0
- package/res/account-v1/messages/messages_sk.properties +196 -0
- package/res/account-v1/messages/messages_sv.properties +150 -0
- package/res/account-v1/messages/messages_tr.properties +315 -0
- package/res/account-v1/messages/messages_zh_CN.properties +153 -0
- package/res/account-v1/password.ftl +59 -0
- package/res/account-v1/resource-detail.ftl +277 -0
- package/res/account-v1/resources/css/account.css +277 -0
- package/res/account-v1/resources/img/icon-sidebar-active.png +0 -0
- package/res/account-v1/resources/img/keycloak-logo.png +0 -0
- package/res/account-v1/resources/img/logo.png +0 -0
- package/res/account-v1/resources/resources-common/img/favicon.ico +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
- package/res/account-v1/resources.ftl +403 -0
- package/res/account-v1/sessions.ftl +44 -0
- package/res/account-v1/template.ftl +88 -0
- package/res/account-v1/theme.properties +14 -0
- package/res/account-v1/totp.ftl +141 -0
- package/res/public/.keycloakify/account/css/account.css +277 -0
- package/res/public/.keycloakify/account/img/icon-sidebar-active.png +0 -0
- package/res/public/.keycloakify/account/img/keycloak-logo.png +0 -0
- package/res/public/.keycloakify/account/img/logo.png +0 -0
- package/res/public/.keycloakify/account/resources-common/img/favicon.ico +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
- package/res/public/.keycloakify/login/css/login.css +629 -0
- package/res/public/.keycloakify/login/img/feedback-error-arrow-down.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-error-sign.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-success-arrow-down.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-success-sign.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-warning-arrow-down.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-warning-sign.png +0 -0
- package/res/public/.keycloakify/login/img/keycloak-bg.png +0 -0
- package/res/public/.keycloakify/login/img/keycloak-logo-text.png +0 -0
- package/res/public/.keycloakify/login/img/keycloak-logo.png +0 -0
- package/res/public/.keycloakify/login/js/authChecker.js +49 -0
- package/res/public/.keycloakify/login/js/common.js +48 -0
- package/res/public/.keycloakify/login/js/kcMultivalued.js +106 -0
- package/res/public/.keycloakify/login/js/kcNumberFormat.js +21 -0
- package/res/public/.keycloakify/login/js/kcNumberUnFormat.js +19 -0
- package/res/public/.keycloakify/login/js/menu-button-links.js +315 -0
- package/{src/bin/shared/downloadKeycloakDefaultTheme/extra-assets → res/public/.keycloakify/login/js}/passkeysConditionalAuth.js +1 -1
- package/res/public/.keycloakify/login/js/passwordVisibility.js +15 -0
- package/res/public/.keycloakify/login/js/userProfile.js +71 -0
- package/res/public/.keycloakify/login/js/webauthnRegister.js +140 -0
- package/res/public/.keycloakify/login/resources-common/img/favicon.ico +0 -0
- package/res/public/.keycloakify/login/resources-common/lib/pficon/pficon.css +22 -0
- package/res/public/.keycloakify/login/resources-common/lib/pficon/pficon.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/@patternfly/patternfly/patternfly.min.css +2 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/jquery/dist/jquery.min.js +2 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.ttf +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/fontawesome-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/img/bg-login.jpg +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/rfc4648/lib/rfc4648.js +178 -0
- package/src/PUBLIC_URL.ts +5 -3
- package/src/account/KcContext/kcContextMocks.ts +3 -3
- package/src/bin/copy-keycloak-resources-to-public.ts +1 -1
- package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +4 -1
- package/src/bin/initialize-email-theme.ts +28 -8
- package/src/bin/keycloakify/buildJars/buildJar.ts +3 -7
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +3 -7
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +65 -90
- package/src/bin/keycloakify/keycloakify.ts +38 -21
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +2 -2
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +3 -3
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +3 -3
- package/src/bin/shared/buildContext.ts +1 -8
- package/src/bin/shared/constants.ts +5 -7
- package/src/bin/shared/copyKeycloakResourcesToPublic.ts +30 -40
- package/src/bin/start-keycloak/start-keycloak.ts +3 -7
- package/src/login/KcContext/KcContext.ts +9 -18
- package/src/login/KcContext/kcContextMocks.ts +5 -13
- package/src/login/Template.tsx +4 -67
- package/src/login/Template.useStylesAndScripts.ts +94 -0
- package/src/login/pages/Login.tsx +1 -1
- package/src/login/pages/LoginIdpLinkConfirmOverride.tsx +0 -1
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.tsx +6 -81
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.useScript.tsx +72 -0
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +4 -126
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.useScript.tsx +142 -0
- package/src/login/pages/LoginUsername.tsx +1 -1
- package/src/login/pages/Register.tsx +35 -13
- package/src/login/pages/WebauthnAuthenticate.tsx +20 -133
- package/src/login/pages/WebauthnAuthenticate.useScript.tsx +64 -0
- package/src/login/pages/WebauthnRegister.tsx +8 -195
- package/src/login/pages/WebauthnRegister.useScript.tsx +93 -0
- package/src/tools/useInsertScriptTags.ts +14 -4
- package/src/vite-plugin/vite-plugin.ts +11 -15
- package/tools/useInsertScriptTags.d.ts +2 -2
- package/tools/useInsertScriptTags.js +8 -2
- package/tools/useInsertScriptTags.js.map +1 -1
- package/vite-plugin/index.js +3357 -47132
- package/bin/697.index.js +0 -4749
- package/bin/shared/downloadKeycloakStaticResources.d.ts +0 -9
- package/bin/shared/downloadKeycloakStaticResources.js.map +0 -1
- package/src/bin/keycloakify/generateResources/bringInAccountV1.ts +0 -89
- package/src/bin/shared/downloadKeycloakDefaultTheme/downloadKeycloakDefaultTheme.ts +0 -337
- package/src/bin/shared/downloadKeycloakDefaultTheme/index.ts +0 -1
- package/src/bin/shared/downloadKeycloakStaticResources.ts +0 -53
- /package/{src/bin/shared/downloadKeycloakDefaultTheme/extra-assets → res/public/.keycloakify/login/js}/webauthnAuthenticate.js +0 -0
@@ -0,0 +1,140 @@
|
|
1
|
+
import { base64url } from "rfc4648";
|
2
|
+
|
3
|
+
export async function registerByWebAuthn(input) {
|
4
|
+
|
5
|
+
// Check if WebAuthn is supported by this browser
|
6
|
+
if (!window.PublicKeyCredential) {
|
7
|
+
returnFailure(input.errmsg);
|
8
|
+
return;
|
9
|
+
}
|
10
|
+
|
11
|
+
const publicKey = {
|
12
|
+
challenge: base64url.parse(input.challenge, {loose: true}),
|
13
|
+
rp: {id: input.rpId, name: input.rpEntityName},
|
14
|
+
user: {
|
15
|
+
id: base64url.parse(input.userid, {loose: true}),
|
16
|
+
name: input.username,
|
17
|
+
displayName: input.username
|
18
|
+
},
|
19
|
+
pubKeyCredParams: getPubKeyCredParams(input.signatureAlgorithms),
|
20
|
+
};
|
21
|
+
|
22
|
+
if (input.attestationConveyancePreference !== 'not specified') {
|
23
|
+
publicKey.attestation = input.attestationConveyancePreference;
|
24
|
+
}
|
25
|
+
|
26
|
+
const authenticatorSelection = {};
|
27
|
+
let isAuthenticatorSelectionSpecified = false;
|
28
|
+
|
29
|
+
if (input.authenticatorAttachment !== 'not specified') {
|
30
|
+
authenticatorSelection.authenticatorAttachment = input.authenticatorAttachment;
|
31
|
+
isAuthenticatorSelectionSpecified = true;
|
32
|
+
}
|
33
|
+
|
34
|
+
if (input.requireResidentKey !== 'not specified') {
|
35
|
+
if (input.requireResidentKey === 'Yes') {
|
36
|
+
authenticatorSelection.requireResidentKey = true;
|
37
|
+
} else {
|
38
|
+
authenticatorSelection.requireResidentKey = false;
|
39
|
+
}
|
40
|
+
isAuthenticatorSelectionSpecified = true;
|
41
|
+
}
|
42
|
+
|
43
|
+
if (input.userVerificationRequirement !== 'not specified') {
|
44
|
+
authenticatorSelection.userVerification = input.userVerificationRequirement;
|
45
|
+
isAuthenticatorSelectionSpecified = true;
|
46
|
+
}
|
47
|
+
|
48
|
+
if (isAuthenticatorSelectionSpecified) {
|
49
|
+
publicKey.authenticatorSelection = authenticatorSelection;
|
50
|
+
}
|
51
|
+
|
52
|
+
if (input.createTimeout !== 0) {
|
53
|
+
publicKey.timeout = input.createTimeout * 1000;
|
54
|
+
}
|
55
|
+
|
56
|
+
const excludeCredentials = getExcludeCredentials(input.excludeCredentialIds);
|
57
|
+
if (excludeCredentials.length > 0) {
|
58
|
+
publicKey.excludeCredentials = excludeCredentials;
|
59
|
+
}
|
60
|
+
|
61
|
+
try {
|
62
|
+
const result = await doRegister(publicKey);
|
63
|
+
returnSuccess(result, input.initLabel, input.initLabelPrompt);
|
64
|
+
} catch (error) {
|
65
|
+
returnFailure(error);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
function doRegister(publicKey) {
|
70
|
+
return navigator.credentials.create({publicKey});
|
71
|
+
}
|
72
|
+
|
73
|
+
function getPubKeyCredParams(signatureAlgorithmsList) {
|
74
|
+
const pubKeyCredParams = [];
|
75
|
+
if (signatureAlgorithmsList.length === 0) {
|
76
|
+
pubKeyCredParams.push({type: "public-key", alg: -7});
|
77
|
+
return pubKeyCredParams;
|
78
|
+
}
|
79
|
+
|
80
|
+
for (const entry of signatureAlgorithmsList) {
|
81
|
+
pubKeyCredParams.push({
|
82
|
+
type: "public-key",
|
83
|
+
alg: entry
|
84
|
+
});
|
85
|
+
}
|
86
|
+
|
87
|
+
return pubKeyCredParams;
|
88
|
+
}
|
89
|
+
|
90
|
+
function getExcludeCredentials(excludeCredentialIds) {
|
91
|
+
const excludeCredentials = [];
|
92
|
+
if (excludeCredentialIds === "") {
|
93
|
+
return excludeCredentials;
|
94
|
+
}
|
95
|
+
|
96
|
+
for (const entry of excludeCredentialIds.split(',')) {
|
97
|
+
excludeCredentials.push({
|
98
|
+
type: "public-key",
|
99
|
+
id: base64url.parse(entry, {loose: true})
|
100
|
+
});
|
101
|
+
}
|
102
|
+
|
103
|
+
return excludeCredentials;
|
104
|
+
}
|
105
|
+
|
106
|
+
function getTransportsAsString(transportsList) {
|
107
|
+
if (!Array.isArray(transportsList)) {
|
108
|
+
return "";
|
109
|
+
}
|
110
|
+
|
111
|
+
return transportsList.join();
|
112
|
+
}
|
113
|
+
|
114
|
+
function returnSuccess(result, initLabel, initLabelPrompt) {
|
115
|
+
document.getElementById("clientDataJSON").value = base64url.stringify(new Uint8Array(result.response.clientDataJSON), {pad: false});
|
116
|
+
document.getElementById("attestationObject").value = base64url.stringify(new Uint8Array(result.response.attestationObject), {pad: false});
|
117
|
+
document.getElementById("publicKeyCredentialId").value = base64url.stringify(new Uint8Array(result.rawId), {pad: false});
|
118
|
+
|
119
|
+
if (typeof result.response.getTransports === "function") {
|
120
|
+
const transports = result.response.getTransports();
|
121
|
+
if (transports) {
|
122
|
+
document.getElementById("transports").value = getTransportsAsString(transports);
|
123
|
+
}
|
124
|
+
} else {
|
125
|
+
console.log("Your browser is not able to recognize supported transport media for the authenticator.");
|
126
|
+
}
|
127
|
+
|
128
|
+
let labelResult = window.prompt(initLabelPrompt, initLabel);
|
129
|
+
if (labelResult === null) {
|
130
|
+
labelResult = initLabel;
|
131
|
+
}
|
132
|
+
document.getElementById("authenticatorLabel").value = labelResult;
|
133
|
+
|
134
|
+
document.getElementById("register").submit();
|
135
|
+
}
|
136
|
+
|
137
|
+
function returnFailure(err) {
|
138
|
+
document.getElementById("error").value = err;
|
139
|
+
document.getElementById("register").submit();
|
140
|
+
}
|
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/*!
|
2
|
+
* This folder contains updated PatternFly4 icons (version 2020.13).
|
3
|
+
* After the PF4 transition is finished this folder will be deleted.
|
4
|
+
*/
|
5
|
+
|
6
|
+
@font-face {
|
7
|
+
font-family: "pficon-tmp";
|
8
|
+
src: url("./pficon.woff2") format("woff2");
|
9
|
+
}
|
10
|
+
|
11
|
+
.pf-icon-openshift:before {
|
12
|
+
font-family: "pficon-tmp";
|
13
|
+
-webkit-font-smoothing: antialiased;
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
15
|
+
font-style: normal;
|
16
|
+
font-variant: normal;
|
17
|
+
font-weight: normal;
|
18
|
+
text-decoration: none;
|
19
|
+
text-transform: none; }
|
20
|
+
|
21
|
+
.pf-icon-openshift:before {
|
22
|
+
content: ""; }
|