This topic explains how to configure Multi-Factor Authentication (MFA) in Keycloak as
an administrator, including how to set MFA as a default requirement for new users and how to
require specific users to set up MFA at their next login.
-
Configure MFA settings for a realm
-
Log in to the Keycloak administration console.
-
Click Manage realms in the main menu.
-
Select the realm where you want to configure MFA.
If you are already in the correct realm, you can skip this
step.
-
Click Authentication in the left navigation menu.
-
Open the Policies tab.
-
Select the OTP Policy sub-tab.
-
Adjust the One Time Password settings as needed for your
organization.
Keycloak currently supports FreeOTP, Google Authenticator, and
Microsoft Authenticator. Not all OTP policy options are compatible with
all of these providers. For more information, see
Keycloak OTP Policy documentation.
-
Set MFA as a default requirement for all new users
-
Log in to the Keycloak administration console.
-
Click Manage realms in the main menu.
-
Select the realm where you want to require MFA for new users.
If you are already in the correct realm, you can skip this
step.
-
Click Authentication in the left navigation menu.
-
Open the Required Actions tab.
-
Locate the action Configure OTP and enable Set as default
action.
-
Require a specific user to set up MFA at next login
-
Log in to the Keycloak administration console.
-
Click Manage realms in the main menu.
-
Select the realm where the user account is located.
If you are already in the correct realm, you can skip this
step.
-
Click Users in the left navigation menu.
-
Click the username of the user who should be required to set up
MFA.
-
In the Details tab, find the Required user actions field
and select Configure OTP.
-
Click Save to apply the changes.