You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Giuliano Mele b431641fba
Fix converter: 0 to +49 + add logs
3 days ago
.github Add jar hash files to release artifacts 1 month ago
.vscode Add vscode tabs format settings 1 month ago
src/main Fix converter: 0 to +49 + add logs 3 days ago
.editorconfig initial commit 2 years ago
.gitignore Change gitignore 2 months ago
CHANGELOG.md Bump v0.2.0 1 month ago
LICENSE Fix LICENSE headers & indentation 2 months ago
README.md README: update install instructions 1 month ago
pom.xml Fix converter: 0 to +49 + add logs 3 days ago

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

  1. Clone this repository
  2. Install Apache Maven
  3. Change into the cloned directory and run
    mvn package
    
    A file target/netzbegruenung.keycloak-2fa-sms-authenticator.jar should be created.

Installing

  1. Go to https://github.com/netzbegruenung/keycloak-2fa-sms-authenticator/releases and download the latest .jar file.
  2. Copy the created jar file into the providers directory of your Keycloak:
    cp netzbegruenung.keycloak-2fa-sms-authenticator.jar /path/to/keycloak/providers
    
  3. Run the build command and restart Keycloak:
    /path/to/keycloak/bin/kc.sh build [your-additional-flags]
    systemctl restart keycloak.service
    

Usage

  1. Add a new execution to the 2FA flow of your Browser flow, choose "SMS Authentication (2FA)".
  2. 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.
  3. Go into the config of the execution and configure the plugin so that it works with the API of your SMS proivder.