We have implemented 2FA and it has been working fine in earlier version of v17. Recently, we upgraded to v17.5.0 and it seems that Customizing the 2FA activation screen is not working. It is using the default 2FA screen. It is not picking up /App_Plugins/TwoFactorProviders/2fa-activation.js
Please can you provide your thoughts on this issue or if you need any further information then I happy to relay.
{
"$schema": "../../umbraco-package-schema.json",
"name": "2fa providers",
"version": "1.0.0",
"extensions": [
{
"type": "mfaActivationProvider",
"alias": "UmbracoUserAppAuthenticator",
"name": "UmbracoUserAppAuthenticator",
"forProviderName": "UmbracoUserAppAuthenticator",
"element": "/App_Plugins/TwoFactorProviders/2fa-activation.js", // This line is the only change
"meta": {
"label": "Google Authenticator"
}
}
]
}
The extension type looks wrong. In v17 the only MFA type in the registry is mfaLoginProvider, there’s no mfaActivationProvider. An entry with a type that doesn’t match anything just gets discarded, which is why you’re getting the default screen.
Also, I assume the comments in your JSON file are added for this post as that is not valid JSON if they are actually present…
If nothing is working for you, it may be worth you raising an issue on the Umbraco issue tracker, explaining that you’re following the docs but it’s not working.
Justin is right — this is a documentation error, and I’m afraid it’s been there since the v14 docs were written (by me, no less ). The extension type has only ever been mfaLoginProvider in the source; mfaActivationProvider has never existed. The article even uses the correct type in the earlier registration step and then switches to the wrong one in the “final form” snippet.
If you change the type in your umbraco-package.json to mfaLoginProvider, your custom activation element should load. One thing worth knowing: with the wrong type, the manifest is silently ignored and the built-in activation screen is shown instead — which also displays a QR code and a code input, so it’s easy to mistake it for a custom one. That’s most likely why it appeared to work in earlier versions; nothing changed in 17.5 in how these extensions are resolved.
Please let me know if it works after the change, and thanks for reporting it!