mirror of
https://github.com/netzbegruenung/keycloak-2fa-sms-authenticator.git
synced 2024-05-11 15:16:09 +02:00
|
||
---|---|---|
.github | ||
.vscode | ||
src/main | ||
.editorconfig | ||
.gitignore | ||
LICENSE | ||
pom.xml | ||
README.md |
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.
This is a fork of a great demo implementation by @dasniko, and also takes huge chunks of code from the original authenticator provider documentation and example from Keycloak itself.
License
The code of this project is Apache 2.0 licensed. Parts of the original code are MIT licensed.
Building
- Clone this repository
- Install Apache Maven
- Change into the cloned directory and run
A filemvn package
target/netzbegruenung.keycloak-2fa-sms-authenticator.jar
should be created.
Installing
- Go to https://github.com/netzbegruenung/keycloak-2fa-sms-authenticator/releases and download the latest .jar file.
- Copy the created jar file into the
providers
directory of your Keycloak:cp netzbegruenung.keycloak-2fa-sms-authenticator.jar /path/to/keycloak/providers
- Run the
build
command and restart Keycloak:/path/to/keycloak/bin/kc.sh build [your-additional-flags] systemctl restart keycloak.service
Usage
- 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.