|
| 1 | +--- |
| 2 | +layout: home |
| 3 | +landing-title: "Using Microsoft Authenticator with OpenAM" |
| 4 | +landing-title2: "Using Microsoft Authenticator with OpenAM" |
| 5 | +description: Step-by-step guide to implementing two-factor authentication (2FA) in OpenAM using Microsoft Authenticator and TOTP. |
| 6 | +keywords: 'OpenAM, two-factor authentication, 2FA, TOTP, Microsoft Authenticator, access control, OpenAM configuration, authentication module, OATH, multi-factor authentication, secure login, identity management, Open Identity Platform, device registration, authentication chain' |
| 7 | +imageurl: 'openam-og.png' |
| 8 | +share-buttons: true |
| 9 | + |
| 10 | +--- |
| 11 | +# Using Microsoft Authenticator with OpenAM |
| 12 | + |
| 13 | +This article is intended for technical specialists or security system architects who want to implement two-factor authentication (2FA) in an access control system to enhance the security of user accounts. |
| 14 | + |
| 15 | +Adding a second factor makes it significantly more difficult for attackers to compromise accounts. |
| 16 | + |
| 17 | +## Stack Used |
| 18 | + |
| 19 | +**OpenAM** is an open-source access management system. It is designed for centralized management of authentication, authorization, and user accounts. |
| 20 | + |
| 21 | +**Microsoft Authenticator** is a mobile application designed to be used as an additional authentication factor. It supports push notifications, one-time passwords (TOTP), and biometric authentication. |
| 22 | + |
| 23 | +In this article, we will deploy OpenAM, configure modules and authentication chains for use with Microsoft Authenticator, and show you how to add a second factor authentication for a user. |
| 24 | + |
| 25 | +We will use authentication with one-time passwords generated using the TOTP (time-based one-time password) protocol. Such passwords do not need to be sent to the client device via SMS or PUSH notifications. These passwords are generated using a specific cryptographic algorithm directly on the device. |
| 26 | + |
| 27 | +## Installing OpenAM |
| 28 | + |
| 29 | +If you do not have OpenAM installed yet, you can deploy a Docker container as described in the [OpenAM wiki article](https://github.com/OpenIdentityPlatform/OpenAM/wiki/TIP%3A-Quick-OpenAM-Docker-Configuration-From-a-Command-Line) |
| 30 | + |
| 31 | +## Configuring OpenAM |
| 32 | + |
| 33 | +We will configure the module and authentication chain. |
| 34 | + |
| 35 | +The authentication module in OpenAM is responsible for a specific authentication method. This can be authentication with a username and password, via the Kerberos protocol, or using biometrics. |
| 36 | +Modules can be organized into chains. This allows you to build chains of modules to authenticate users in multiple stages or using different methods. For example, if seamless authentication via the Kerberos protocol fails, you can ask the user for their login and password. |
| 37 | + |
| 38 | +### **Configuring the TOTP Authentication Module** |
| 39 | + |
| 40 | +Open the administrator console at [http://openam.example.org:8080/openam/console](http://openam.example.org:8080/openam/console) |
| 41 | + |
| 42 | +In the login field, enter `amadmin`. In the password field, enter the administrator password specified during installation. |
| 43 | + |
| 44 | +Open the root realm, select Authentication → Modules in the left menu, and click the `Add Module` button. In the form that appears, enter the module name, for example `totp`, and the module type - `Authenticator (OATH)`. Click the `Create` button. |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +Set the `OATH Algorithm to Use` setting to `TOTP`, enter any non-empty value in the `Name of the Issuer` field, for example `OpenAM`, and click `Save Changes`. |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +### **Configuring the Device Registration Chain** |
| 53 | + |
| 54 | +The registration chain is required so that authenticated users can add a second authentication factor using Microsoft Authenticator. |
| 55 | + |
| 56 | +In the administrator console, in the realm settings in the left menu, select Authentication → Chains and click the `Add Chain` button in the list that opens. |
| 57 | + |
| 58 | +Enter the chain name `totp-register` and click the `Create` button. |
| 59 | + |
| 60 | +In the chain settings, click the `Add a Module` button and add the created `totp` authentication module as shown in the figure. Click the `OK` button and then `Save Changes`. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +### **Configuring the Authentication Chain** |
| 65 | + |
| 66 | +In this chain, we will configure authentication so that after authenticating with a username and password, the user is required to enter a one-time password from the Microsoft Authenticator mobile app. |
| 67 | + |
| 68 | +In the administrator console, in the realm settings in the left menu, select Authentication → Chains and click the `Add Chain` button in the list that opens. |
| 69 | + |
| 70 | +Enter the chain name `totp-login` and click the `Create` button. First, add the `DataStore` login and password authentication module. Then add the `totp` one-time code authentication module. |
| 71 | + |
| 72 | +Click `Save Changes`. |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +## Setting up Microsoft Authenticator. |
| 77 | + |
| 78 | +Download the [Microsoft Authenticator](https://www.microsoft.com/en/security/mobile-authenticator-app) app from the appropriate app store for your device. |
| 79 | + |
| 80 | +### Registering a Device |
| 81 | + |
| 82 | +Sign in to the console with a test user account. To do this, eiter sign out of the administrator console or open your browser in incognito mode. Go to the URL [http://openam.example.org:8080/openam/XUI/#login/](http://openam.example.org:8080/openam/XUI/#login/) and log in to OpenAM with the `demo` account. The default password is `changeit`. |
| 83 | + |
| 84 | +After successful authentication, open the device registration chain link in your browser. [http://openam.example.org:8080/openam/XUI/#login&service=totp-register](http://openam.example.org:8080/openam/XUI/#login&service=totp-register). |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | +Open the Microsoft Authenticator app and tap `Add account` button. |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +Select `Other account` |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +You will be prompted to scan a QR code. Scan the QR code displayed in the OpenAM browser window. After scanning, the OpenAM account will be added to the Microsoft Authenticator app. |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +Locate the newly added account. A one-time password will be displayed. |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | +In your browser, click the `Login Using Verification Code` button. |
| 105 | + |
| 106 | +Enter the one-time password from the mobile app and click the `Submit` button. |
0 commit comments