RedFroggy / keycloak-registration-invitation

Register user with invitation
MIT License
33 stars 8 forks source link

keycloak-registration-invitation

Register user with invitation

This Keycloak plugin adds a form action and a required action to register user with invitation.

Build Status

Features

Compatibility

The version 11.0 of this plugin is compatible with Keycloak 11.0.3 and higher.

Installation

The plugin installation is simple and can be done without a Keycloak server restart.

You can also clone the Github Repository and install the plugin locally with the following command:

$ mvn clean install wildfly:deploy

How to use it

Requirements

Form action 'RegistrationInvitation' and 'WebhookRegistrationSuccess' required action are deploy in keycloak. Got to {keycloak url}/auth/admin/master/console/#/server-info/providers.

server-info-providers-required-action server-info-providers-form-action

Configuration

WebhookRegistrationSuccess required action

Once the installation is complete, the Webhook Registration Success required action appears in " authentication/required-actions" on your realm. Register and enable Webhook Registration Success. required-actions-conf

RegistrationInvitation form

Create your own 'registration flow' in /authentication/flows/registration on your realm.

  1. Copy registration to 'Registration With Invitation' copy-registration-flow
  2. Add Invitation Validation execution to 'Registration With Invitation' Registration Form add-execution
  3. Add config to 'Invitation Validation' add-invitationForm-config
  4. Save config with alias 'invitation', the alias must be 'invitation' save-invitation-config

Templates

You can override individual templates in your own theme. To create a custom register form for the mytheme theme copy register.ftl (in redfroggy theme) to themes/mytheme/login/.

How to test it

  1. clone this repo git@github.com:RedFroggy/keycloak-registration-invitation.gi
    git clone git@github.com:RedFroggy/keycloak-registration-invitation.git
  1. package jar

    mvn package

Example to build with docker

cd keycloak-registration-invitation
docker run --rm -v "$(pwd)":/opt/maven -w /opt/maven maven:3.8.2-jdk-8 mvn -f /opt/maven/pom.xml clean package
  1. run docker-compose
    docker-compose up -d --build --force-recreate

4. test registration

Q&A

See Q&A

How to contribute

See here