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: 13/umbraco-cms/reference/security/two-factor-authentication.md
+73-33Lines changed: 73 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ This article includes guides for implementing two-factor authentication options
11
11
*[Two-Factor Authentication for Members](#two-factor-authentication-for-members)
12
12
*[Two-Factor Authentication for Users](#two-factor-authentication-for-users)
13
13
14
+
Two-factor authentication (2FA) for Umbraco Users and Members is activated by implementing an `ITwoFactorProvider` interface and registering the implementation. The implementation can use third-party packages to support authentication apps like the Microsoft- or Google Authentication Apps.
15
+
14
16
{% hint style="info" %}
15
17
16
18
If you are using [Umbraco Cloud](https://umbraco.com/products/umbraco-cloud/), you can enable multi-factor authentication in Umbraco ID. For more information, see the [Multi-Factor Authentication](https://docs.umbraco.com/umbraco-cloud/set-up/multi-factor-authentication-on-cloud) article.
@@ -19,8 +21,6 @@ If you are using [Umbraco Cloud](https://umbraco.com/products/umbraco-cloud/), y
19
21
20
22
## Two-factor authentication for Members
21
23
22
-
Two-factor authentication (2FA) for Umbraco members is activated by implementing an `ITwoFactorProvider` interface and registering the implementation. The implementation can use third-party packages to support authentication apps like the Microsoft- or Google Authentication Apps.
23
-
24
24
The following guide will take you through implementing an option for your website members to enable two-factor authentication.
25
25
26
26
{% hint style="info" %}
@@ -224,7 +224,7 @@ At this point, the 2FA is active, but no members have set up 2FA yet. The setup
224
224
225
225

226
226
227
-
### Test the set up
227
+
### Test the set up for Members
228
228
229
229
1. Login to the website using a test member.
230
230
2. Navigate to the page where the QR code was added.
@@ -242,11 +242,19 @@ 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: `TwoFactorAuthInfo.cs`.
255
+
3. Update the file with the following code snippet.
@@ -333,17 +345,19 @@ public class UmbracoUserAppAuthenticator : ITwoFactorProvider
333
345
}
334
346
```
335
347
336
-
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.
348
+
{% endcode %}
349
+
350
+
4. Update `namespace` on line 7 to match your project.
351
+
5. Customize the `applicationName` variable on line 59.
352
+
6. Create a new file in your project: `UmbracoAppAuthenticatorComposer.cs`.
353
+
7. Implement a new composer and register the `UmbracoAppAuthenticator` implementation as shown below.
337
354
338
-
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.
At this point, the 2FA is active, but no users have set it up.
555
+
556
+
### Test the set up for Users
557
+
558
+
Each user can now enable the configured 2fa providers on their user.
559
+
560
+
1. Access the Umbraco backoffice.
561
+
2. Click the user avatar in the top-right corner.
520
562
521
563

522
564
523
-
When clicking the `Configure Two-Factor` button, a new panel is shown, listing all enabled two-factor providers.
565
+
3. Select `Configure Two-Factor` button to open a new panel listing all enabled two-factor providers.
524
566
525
567

526
568
527
-
When clicking`Enable`on one of these, the configured view for the specific provider will be shown
569
+
4. Select`Enable`to show the configured view.
528
570
529
571

530
572
531
-
When the authenticator is enabled correctly, a disable button is shown instead.
573
+
5. Follow the instructions to configure 2FA.
532
574
533
-

534
-
535
-
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.
575
+
When the authenticator is enabled correctly, a disable button is shown instead.
536
576
537
-

577
+

538
578
539
-
If the code is correct, the provider is disabled.
579
+
To disable the two-factor authentication on your user, it is required to enter the verification code.
0 commit comments