From 26e0b3a8464d5b78945b91817dd756759bc32ebd Mon Sep 17 00:00:00 2001 From: Matheus Martins Sarmento Date: Fri, 3 Jun 2022 11:38:15 -0300 Subject: [PATCH] feat(2fa) add base of 2fa --- themes/ilhasoft/login/login-config-totp.ftl | 108 ++++++++++++++++++++ themes/ilhasoft/login/login-otp.ftl | 58 +++++++++++ 2 files changed, 166 insertions(+) create mode 100755 themes/ilhasoft/login/login-config-totp.ftl create mode 100755 themes/ilhasoft/login/login-otp.ftl diff --git a/themes/ilhasoft/login/login-config-totp.ftl b/themes/ilhasoft/login/login-config-totp.ftl new file mode 100755 index 0000000..8992a56 --- /dev/null +++ b/themes/ilhasoft/login/login-config-totp.ftl @@ -0,0 +1,108 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout displayMessage=true; section> + + <#if section = "header"> + ${msg("loginTotpTitle")} + <#elseif section = "form"> +
    +
  1. +

    ${msg("loginTotpStep1")}

    + +
      + <#list totp.policy.supportedApplications as app> +
    • ${app}
    • + +
    +
  2. + + <#if mode?? && mode = "manual"> +
  3. +

    ${msg("loginTotpManualStep2")}

    +

    ${totp.totpSecretEncoded}

    +

    ${msg("loginTotpScanBarcode")}

    +
  4. +
  5. +

    ${msg("loginTotpManualStep3")}

    +

    +

      +
    • ${msg("loginTotpType")}: ${msg("loginTotp." + totp.policy.type)}
    • +
    • ${msg("loginTotpAlgorithm")}: ${totp.policy.getAlgorithmKey()}
    • +
    • ${msg("loginTotpDigits")}: ${totp.policy.digits}
    • + <#if totp.policy.type = "totp"> +
    • ${msg("loginTotpInterval")}: ${totp.policy.period}
    • + <#elseif totp.policy.type = "hotp"> +
    • ${msg("loginTotpCounter")}: ${totp.policy.initialCounter}
    • + +
    +

    +
  6. + <#else> +
  7. +

    ${msg("loginTotpStep2")}

    + Figure: Barcode
    +

    ${msg("loginTotpUnableToScan")}

    +
  8. + +
  9. +

    ${msg("loginTotpStep3")}

    +

    ${msg("loginTotpStep3DeviceName")}

    +
  10. +
+ +
+
+
+ * +
+
+ + + <#if false> + + ${kcSanitize(messagesPerField.get('totp'))?no_esc} + + + +
+ + <#if mode??> +
+ +
+
+ <#if totp.otpCredentials?size gte 1>* +
+ +
+ + + <#if false> + + ${kcSanitize(messagesPerField.get('userLabel'))?no_esc} + + +
+
+ + <#if isAppInitiatedAction??> + + + <#else> + + +
+ + \ No newline at end of file diff --git a/themes/ilhasoft/login/login-otp.ftl b/themes/ilhasoft/login/login-otp.ftl new file mode 100755 index 0000000..2e1054d --- /dev/null +++ b/themes/ilhasoft/login/login-otp.ftl @@ -0,0 +1,58 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout displayMessage=true; section> + <#if section="header"> + ${msg("doLogIn")} + <#elseif section="form"> +
+ <#if otpLogin.userOtpCredentials?size gt 1> +
+
+ <#list otpLogin.userOtpCredentials as otpCredential> + checked="checked"> + + +
+
+ + +
+
+ +
+ +
+ + + <#if false> + + ${kcSanitize(messagesPerField.get('totp'))?no_esc} + + +
+
+ +
+
+
+
+
+ +
+ +
+
+
+ + \ No newline at end of file