Skip to content

Latest commit

History

History
29 lines (21 loc) 路 1.72 KB

email-domain-acceptlist.md

File metadata and controls

29 lines (21 loc) 路 1.72 KB
description
Only allow specific emails to register.

馃拏 Email domain acceptlist

{% embed url="https://user-images.githubusercontent.com/6702424/164943571-560cdccb-2c68-40b8-bd45-c229401f3fd4.mp4" %} Can't register with a @gmail.com address {% endembed %}

{% tabs %} {% tab title="With user profile" %} Using user profile capabilities of keycloak you can define a Regexp on the email field that will only allow certain domails to register.

The Regexp should look something like this and can be generated easily with this helper.

Find the source code of the register page showed in the video here. {% endtab %}

{% tab title="With a third party Keycloak plugin" %} The legacy way of doing it would be with this plugin and usingkcContext["authorizedMailDomains"] to validate in realtime.

Relevent code here and here. {% endtab %} {% endtabs %}

{% embed url="https://cloud-iam.com/?mtm_campaign=keycloakify-deal&mtm_source=keycloakify-doc-email-domain-acceptlist" %} Feeling overwhelmed? Check out our exclusive sponsor's Cloud IAM consulting services to simplify your experience. {% endembed %}