|Giuliano Mele 4d3dcb6379
Keycloak MFA Plugin collection
This repository contains the source code for a collection of Keycloak MFA plugins. The plugins are:
- SMS authenticator (production ready)
- Force MFA & Selection dialog (work in progress)
- Native App MFA integration (work in progress)
The different plugins are documented below.
Keycloak 2FA SMS Authenticator
Keycloak Authentication Provider implementation to get a 2nd-factor authentication with a OTP/code/token send via SMS with a configurable HTTPS API. It should be possible to interact with most SMS providers. Issues and pull requests to support more SMS providers are welcome.
The code of this project is Apache 2.0 licensed. Parts of the original code are MIT licensed.
- Clone this repository
- Install Apache Maven
- Change into the cloned directory and run
target/netzbegruenung.keycloak-2fa-sms-authenticator.jarshould be created.
- Go to https://github.com/netzbegruenung/keycloak-2fa-sms-authenticator/releases and download the latest .jar file.
- Copy the created jar file into the
providersdirectory of your Keycloak:
cp netzbegruenung.keycloak-2fa-sms-authenticator.jar /path/to/keycloak/providers
- Run the
buildcommand and restart Keycloak:
/path/to/keycloak/bin/kc.sh build [your-additional-flags] systemctl restart keycloak.service
- Add a new execution to the 2FA flow of your Browser flow, choose "SMS Authentication (2FA)".
- Make sure that you name it "sms-2fa". This is currently a hack that will hopefully be fixed. Additional executions with other names can be added. But this first execution will be used for the confirmation SMS when setting up a new phone number.
- Go into the config of the execution and configure the plugin so that it works with the API of your SMS proivder.