It is an alternative authentication method, sending the user a different login code to their email for each login. Usable instead of traditional passwords or as additional identity confirmation (two-step authentication).
It grants improved security, by removing the security issues of relying on user created passwords.
Developed and tested in Keycloak version 12.0.1. Tested for 13.0.1.
For the LoginFlowTest testing the Maildev container must be running. It can be started with the restart.sh
script.
Once keycloak-otp-login
is deployed on your server, (re-)start said server.
You can use ./restart.sh
in the root directory of the project.
Setup:
Now open the web admin console of keycloak, under Configure go to Authentication
. In the Flows
tab create a copy of the Browser
flow.
-
Using instead of passwords
- Delete
Username Password Form
andBrowser - Conditional OTP
in your new flows Forms.
- Add a new execution to
*your flow name* Forms
using theOtp-login
provider and set its requirement toREQUIRED
.
- Delete
-
Using as second step authentication
- Delete
OTP Form
in your new flows Forms.
- Add exec
*your flow name* Browser - Conditional OTP
using theOtp-login
provider and set its requirement toREQUIRED
.
- Delete
Continue with:
-
Switch to the
Bindings
tab and change your Browser Flow to your new flow and save the settings. -
Now open the
Realm Settings
, go to theThemes
tab and select theOtp-Login
for the Login- aswell as the Email Theme. -
Enable
Internationalization
and remove all theSupported Locales
exceptde
anden
(and any languages you added) and set theDefault Locale
to your preference and save.
Inspired by Magic Link authenticator for Keycloak