From a5177023308429842be027b78dbd75619098b1aa Mon Sep 17 00:00:00 2001 From: Joscha <34318751+josxha@users.noreply.github.com> Date: Mon, 8 Jan 2024 10:31:00 +0100 Subject: [PATCH] fix login screen for webauthn --- .../Resources/CustomTranslator.de.resx | 3 +++ .../Resources/CustomTranslator.es.resx | 17 +++++++++++++++++ .../Resources/CustomTranslator.fr.resx | 17 +++++++++++++++++ .../Resources/CustomTranslator.nl.resx | 17 +++++++++++++++++ .../Resources/CustomTranslator.pt.resx | 17 +++++++++++++++++ .../Resources/CustomTranslator.resx | 3 +++ .../Resources/CustomTranslator.se.resx | 17 +++++++++++++++++ .../Shared/Components/KratosUi/Default.cshtml | 10 ++++++---- .../KratosUiNodeInput/InputSubmit.cshtml | 10 ++++++++-- ory/kratos/kratos.yml | 10 ++++++++++ 10 files changed, 115 insertions(+), 6 deletions(-) create mode 100644 KratosSelfService/Resources/CustomTranslator.es.resx create mode 100644 KratosSelfService/Resources/CustomTranslator.fr.resx create mode 100644 KratosSelfService/Resources/CustomTranslator.nl.resx create mode 100644 KratosSelfService/Resources/CustomTranslator.pt.resx create mode 100644 KratosSelfService/Resources/CustomTranslator.se.resx diff --git a/KratosSelfService/Resources/CustomTranslator.de.resx b/KratosSelfService/Resources/CustomTranslator.de.resx index 21ff9fd..938e577 100644 --- a/KratosSelfService/Resources/CustomTranslator.de.resx +++ b/KratosSelfService/Resources/CustomTranslator.de.resx @@ -121,4 +121,7 @@ Hallo + + Anmeldung mit Sicherheitsschlüssel + \ No newline at end of file diff --git a/KratosSelfService/Resources/CustomTranslator.es.resx b/KratosSelfService/Resources/CustomTranslator.es.resx new file mode 100644 index 0000000..ad7ff30 --- /dev/null +++ b/KratosSelfService/Resources/CustomTranslator.es.resx @@ -0,0 +1,17 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Iniciar sesión con la clave de seguridad + + \ No newline at end of file diff --git a/KratosSelfService/Resources/CustomTranslator.fr.resx b/KratosSelfService/Resources/CustomTranslator.fr.resx new file mode 100644 index 0000000..b9ecbc4 --- /dev/null +++ b/KratosSelfService/Resources/CustomTranslator.fr.resx @@ -0,0 +1,17 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + S'identifier avec la clé de sécurité + + \ No newline at end of file diff --git a/KratosSelfService/Resources/CustomTranslator.nl.resx b/KratosSelfService/Resources/CustomTranslator.nl.resx new file mode 100644 index 0000000..08ee9a4 --- /dev/null +++ b/KratosSelfService/Resources/CustomTranslator.nl.resx @@ -0,0 +1,17 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Aanmelden met beveiligingssleutel + + \ No newline at end of file diff --git a/KratosSelfService/Resources/CustomTranslator.pt.resx b/KratosSelfService/Resources/CustomTranslator.pt.resx new file mode 100644 index 0000000..567bd24 --- /dev/null +++ b/KratosSelfService/Resources/CustomTranslator.pt.resx @@ -0,0 +1,17 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Zaloguj się przy użyciu klucza bezpieczeństwa + + \ No newline at end of file diff --git a/KratosSelfService/Resources/CustomTranslator.resx b/KratosSelfService/Resources/CustomTranslator.resx index 49f442c..d459c2f 100644 --- a/KratosSelfService/Resources/CustomTranslator.resx +++ b/KratosSelfService/Resources/CustomTranslator.resx @@ -72,4 +72,7 @@ Hello + + Sign in with security key + \ No newline at end of file diff --git a/KratosSelfService/Resources/CustomTranslator.se.resx b/KratosSelfService/Resources/CustomTranslator.se.resx new file mode 100644 index 0000000..dee2123 --- /dev/null +++ b/KratosSelfService/Resources/CustomTranslator.se.resx @@ -0,0 +1,17 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Logga in med säkerhetsnyckel + + \ No newline at end of file diff --git a/KratosSelfService/Views/Shared/Components/KratosUi/Default.cshtml b/KratosSelfService/Views/Shared/Components/KratosUi/Default.cshtml index 6536bca..54c0ab6 100644 --- a/KratosSelfService/Views/Shared/Components/KratosUi/Default.cshtml +++ b/KratosSelfService/Views/Shared/Components/KratosUi/Default.cshtml @@ -16,10 +16,12 @@ @foreach (var group in groups) {
- @foreach (var node in defaultNodes) - { - var model = new KratosUiNodeModel(node, Model.flowType, Model.forgotPasswordUrl); - @await Component.InvokeAsync("KratosUiNodeInput", model) + @if (group.Key != KratosUiNode.GroupEnum.Oidc) { + foreach (var node in defaultNodes) + { + var model = new KratosUiNodeModel(node, Model.flowType, Model.forgotPasswordUrl); + @await Component.InvokeAsync("KratosUiNodeInput", model) + } } @foreach (var node in group) { diff --git a/KratosSelfService/Views/Shared/Components/KratosUiNodeInput/InputSubmit.cshtml b/KratosSelfService/Views/Shared/Components/KratosUiNodeInput/InputSubmit.cshtml index d4ed873..a66f481 100644 --- a/KratosSelfService/Views/Shared/Components/KratosUiNodeInput/InputSubmit.cshtml +++ b/KratosSelfService/Views/Shared/Components/KratosUiNodeInput/InputSubmit.cshtml @@ -10,7 +10,6 @@ "totp_unlink" => "is-warning", _ => "is-success" }; - }
@@ -22,7 +21,14 @@ value="@attributes.Value" name="@attributes.Name" onclick="@attributes.Onclick"> - @OryTranslator.ForUiText(uiText) + @if (Model.node.Group == KratosUiNode.GroupEnum.Webauthn && Model.node.Meta?.Label.Id == 1010001) + { + @CustomTranslator.Get($"{Model.node.Meta.Label.Id}-webauthn") + } + else + { + @OryTranslator.ForUiText(uiText) + }
@foreach (var message in Model.node.Messages) diff --git a/ory/kratos/kratos.yml b/ory/kratos/kratos.yml index ebbdec0..f4fccf6 100644 --- a/ory/kratos/kratos.yml +++ b/ory/kratos/kratos.yml @@ -28,6 +28,16 @@ selfservice: enabled: true code: enabled: true + webauthn: + enabled: true + config: + passwordless: true + rp: + id: 127.0.0.1 + origins: + - https://127.0.0.1 + origin: https://127.0.0.1 + display_name: OryUI flows: error: