2FA in Umbraco 16

Hi All,

Are these instructions meant to hold up in Umbraco 16?

I’ve tried it and things like:

 IUser? user = _userService.GetByKey(userOrMemberKey);

Don’t seem to exist anymore.

Same with this in the composer:

identityBuilder.AddTwoFactorProvider<UmbracoUserAppAuthenticator>(UmbracoUserAppAuthenticator.Name);

Is there a new way of dealing with 2FA that isn’t documented yet?

Thanks

If you just need/want 2FA for the backoffice users you can use this extension I wrote

https://marketplace.umbraco.com/package/umbraco.community.user2fa

1 Like

Hi @warren this is perfect, thanks for this.

Looks like the code sample isn’t completely up to date with the latest release. Just to correct if you are continuing with your own implementation:

For the first compiler issue, the method on IUserService you need to call now is GetAsync instead of GetByKey . The second looks like you need to import the Umbraco.Extensions namespace to make it available.

1 Like