Developer forum

Forum » CMS - Standard features » TOTP for frontend

TOTP for frontend

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Following up on this forum post, is TOTP now fully implemented? I tried it out and set it up locally but it's not sending an email. Inside EmailHelper.SendOneTimeCodeEmail I see this:

if (Context.Current?.Session is null || string.IsNullOrEmpty(settings.OneTimeCodeTemplate))
            return false;

which implies the App settings class has a field called OneTimeCodeTemplate. However, the App UI for Users - Authentication doesn't show a field for that.

Am I missing something or is this not done done yet?

Imar

 


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Bump! Anyone?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Imar,

The OneTimeCodeTemplate field is implemented and does exist in the paragraph editor — but the entire "One-time code authentication" group is hidden when the system-wide log-on type is set to Normal. You have to switch it first under Settings → Users → Authentication → Log-on type to One-time code (TOTP) (or MFA / Magic links). After that, reload the paragraph and the "Sender name / Sender email / Email subject / One-time code email template" fields appear under the "One-time code authentication" group.

See UserAuthenticationContentModuleAddIn.GetHiddenParameterNames — it hides all OneTimeCode* and MagicLink* parameters while AuthenticationManager.GetLoginType() == LoginType.Normal.

Agreed the discoverability here is poor — there's no hint in the paragraph editor that those fields exist but are gated, and SendOneTimeCodeEmail fails silently if the template is unset. I'll log it for a UX improvement (info text on the paragraph, and a warning when the template is missing at runtime). Also noticed the default email subject for one-time code is "Your log in link", which reads like the magic-link copy — will fix.

I have changed the app so it will always show these settings as single users can have this setup

 

You must be logged in to post in the forum