#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>
<#assign totpDeviceLabel><@totpDeviceLabel.kw />#assign>
<@layout.registrationLayout
displayMessage=!messagesPerField.existsError("totp", "userLabel")
displayRequiredFields=false
;
section
>
<#if section="header">
${msg("loginTotpTitle")}
<#elseif section="form">
-
${msg("loginTotpStep1")}
<#list totp.supportedApplications as app>
- ${msg(app)}
#list>
<#if mode?? && mode="manual">
-
${msg("loginTotpManualStep2")}
${totp.totpSecretEncoded}
-
<@link.kw color="primary" href=totp.qrUrl>
${msg("loginTotpScanBarcode")}
@link.kw>
-
${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}
#if>
<#else>
-
${msg("loginTotpStep2")}
<@link.kw color="primary" href=totp.manualUrl>
${msg("loginTotpUnableToScan")}
@link.kw>
#if>
- ${msg("loginTotpStep3")}
- ${msg("loginTotpStep3DeviceName")}
<@form.kw action=url.loginAction method="post">
<#if mode??>
#if>
<@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>
<@button.kw color="secondary" name="cancel-aia" type="submit" value="true">
${msg("doCancel")}
@button.kw>
<#else>
<@button.kw color="primary" type="submit">
${msg("doSubmit")}
@button.kw>
#if>
@buttonGroup.kw>
@form.kw>
#if>
@layout.registrationLayout>