Skip to content

RedFroggy/keycloak-registration-invitation

Repository files navigation

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

  • Validate invitation from external url
  • Show invitation details in register form
  • Call external url when registration successfull (WebhookRegistrationSuccess required action)

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.

  • Download the latest release from the releases page
  • Copy the JAR file into the standalone/deployments directory in your Keycloak server's root
  • Restart Keycloak (optional, hot deployment should work)

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

test registration

Q&A

See Q&A

How to contribute

See here