<#import "template.ftl" as layout> <#import "components/atoms/button.ftl" as button> <#import "components/atoms/button-group.ftl" as buttonGroup> <#import "components/atoms/form.ftl" as form> <#import "components/atoms/input.ftl" as input> <#import "components/atoms/link.ftl" as link> <#import "features/labels/totp.ftl" as totpLabel> <#import "features/labels/totp-device.ftl" as totpDeviceLabel> <#assign totpLabel><@totpLabel.kw /> <#assign totpDeviceLabel><@totpDeviceLabel.kw /> <@layout.registrationLayout displayMessage=!messagesPerField.existsError("totp", "userLabel") displayRequiredFields=false ; section > <#if section="header"> ${msg("loginTotpTitle")} <#elseif section="form">
  1. ${msg("loginTotpStep1")}

  2. <#if mode?? && mode="manual">
  3. ${msg("loginTotpManualStep2")}

    ${totp.totpSecretEncoded}

  4. <@link.kw color="primary" href=totp.qrUrl> ${msg("loginTotpScanBarcode")}
  5. ${msg("loginTotpManualStep3")}

  6. <#else>
  7. ${msg("loginTotpStep2")}

    Figure: Barcode <@link.kw color="primary" href=totp.manualUrl> ${msg("loginTotpUnableToScan")}
  8. ${msg("loginTotpStep3")}
  9. ${msg("loginTotpStep3DeviceName")}
<@form.kw action=url.loginAction method="post"> <#if mode??> <@input.kw autocomplete="off" autofocus=true invalid=messagesPerField.existsError("totp") label=totpLabel message=kcSanitize(messagesPerField.get("totp")) name="totp" required=false type="text" /> <@input.kw autocomplete="off" invalid=messagesPerField.existsError("userLabel") label=totpDeviceLabel message=kcSanitize(messagesPerField.get("userLabel")) name="userLabel" required=false type="text" /> <@buttonGroup.kw> <#if isAppInitiatedAction??> <@button.kw color="primary" type="submit"> ${msg("doSubmit")} <@button.kw color="secondary" name="cancel-aia" type="submit" value="true"> ${msg("doCancel")} <#else> <@button.kw color="primary" type="submit"> ${msg("doSubmit")}