You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 15/umbraco-cms/reference/security/two-factor-authentication.md
+40-14
Original file line number
Diff line number
Diff line change
@@ -242,13 +242,20 @@ When a 2FA login is requested for a member, the `MemberTwoFactorRequestedNotific
242
242
243
243
## Two-factor authentication for Users
244
244
245
-
Umbraco controls how the UI is for user login and user edits, but will still need a view for configuring each 2FA provider.
245
+
The following guide will take you through implementing an option for backoffice users to enable two-factor authentication.
246
+
247
+
This guide will not cover setting up the UI for user login and edits as this is handled elsewhere in the CMS.
246
248
247
249
### Example implementation for Authenticator Apps for Users
248
250
249
-
In the following example, we will use the [GoogleAuthenticator NuGet Package](https://www.nuget.org/packages/GoogleAuthenticator/). Despite the name, this package works for both Google and Microsoft authenticator apps. It can be used to generate the QR code needed to activate the app for the website.
251
+
As an example, the guide will use the [GoogleAuthenticator NuGet Package](https://www.nuget.org/packages/GoogleAuthenticator/). This package works for both Google and Microsoft authenticator apps. It can be used to generate the QR code needed to activate the app for the website.
252
+
253
+
1. Install the GoogleAuthenticator Nuget Package on your project.
254
+
2. Create a new file in your project: `UmbracoUserAppAuthenticator.cs`.
255
+
3. Update the file with the following code snippet.
First, we create a model with the information required to set up the 2FA provider. Then we implement the `ITwoFactorProvider` with the use of the `TwoFactorAuthenticator` from the GoogleAuthenticator NuGet package.
347
+
4. Update `namespace` on line 7 to match your project.
348
+
5. Customize the `applicationName` variable on line 59.
349
+
6. Create a new file in your project: `UmbracoUserAppAuthenticatorComposer.cs`.
350
+
7. Implement a new composer and register the `UmbracoUserAppAuthenticator` implementation as shown below.
339
351
340
-
Now we need to register the `UmbracoUserAppAuthenticator` implementation and the view to show to set up this provider. This can be done on the `IUmbracoBuilder` in your startup or a composer.
@@ -356,11 +367,18 @@ public class UmbracoAppAuthenticatorComposer : IComposer
356
367
}
357
368
}
358
369
```
370
+
359
371
{% endcode %}
360
372
361
-
The last thing required is to register the provider in the Backoffice client so that the user can enable it. This can be done in a `umbraco-package.json` file.
373
+
8. Update the `namespace` on line 4 to match your project.
374
+
375
+
With the 2FA in place, the provider needs to be registered in the backoffice client in order for the user to be able to use it.
376
+
377
+
9. Add a new file to your project directory: `~/App_Plugins/TwoFactorProviders/umbraco-package.json`.
@@ -379,27 +397,35 @@ The last thing required is to register the provider in the Backoffice client so
379
397
]
380
398
}
381
399
```
400
+
382
401
{% endcode %}
383
402
384
403
At this point, the 2FA is active, but no users have set up 2FA yet.
385
404
386
-
* Each user can now enable the configured 2fa providers on their user. This can be done from the user panel by clicking the user avatar.
405
+
### Test the set up for Users
406
+
407
+
Each user can now enable the configured 2FA providers on their user.
408
+
409
+
1. Access the Umbraco backoffice.
410
+
2. Click the user avatar in the top-right corner.
387
411
388
412

389
413
390
-
* When clicking the `Configure Two-Factor` button, a new panel is shown, listing all enabled two-factor providers.
414
+
3. Select `Configure Two-Factor` button to get a list of all enabled two-factor providers.
391
415
392
416

393
417
394
-
* When clicking `Enable`on one of these, the configured view for the specific provider will be shown
418
+
4. Select `Enable`to show the configured view.
395
419
396
420

397
421
398
-
* When the authenticator is enabled correctly, a disable button is shown instead.
422
+
5. Follow the instructions to configure 2FA.
423
+
424
+
When the authenticator is enabled correctly, a disable button is shown instead.
399
425
400
426

401
427
402
-
*To disable the two-factor authentication on your user, it is required to enter the verification code. Otherwise, admins are allowed to disable providers on other users.
428
+
To disable the two-factor authentication on your user, it is required to enter the verification code.
0 commit comments