Verify email¶
We can enable email verification in Keycloak in 4 different ways.
Verify email using Email confirmation¶
Prerequisites¶
Configure Email Settings for Customer realm¶
To enable Keycloak to send emails, you need to provide Keycloak with your SMTP server settings.
- Access Keycloak as customer_admin.
- In the left sidebar, go to "Realm Settings".
- Under Email tab, fill the fields: Host: SMTP server hostname used for sending emails. Port: SMTP server port From: Address used for the From SMTP-Header for emails sent. Enable Authentication - Set this switch to ON if your SMTP server requires authentication. When prompted, supply the username and password.
- Save the Settings.
Steps:
- Access Keycloak as customer_admin.
- In the left sidebar, go to "Realm Settings".
- Under "Login" tab, look for "Email" settings.
- Enable the "Verify Email" option. This setting typically requires users to verify their email addresses before they can log in.
- Save the settings.
Users need to access their email inbox and follow the instructions to verify their email address.
Enable verify email using Email Verified toggle button¶
- Access Keycloak as customer_admin.
- In the left sidebar, go to "Users".
- To enable Email Verified for existing user, select the user and set the Email Verified toggle button to "On". To enable Email Verified for new user, set the Email Verified toggle button to "On" during user creation.
The user email will be set as verified by default.
Enable verify email using "Trust email" in User Federation¶
- Access Keycloak as customer_admin.
- In the left sidebar, go to "User Federation".
- Go to Add LDAP provider.
- Under Advanced settings, set the "Trust email" toggle button to "On".
- Save the settings.
Enable verify email using "Trust email" in Identity Providers¶
- Access Keycloak as customer_admin.
- In the left sidebar, go to "Identity Providers".
- Select any provider, fill in the mandatory fields.
- Under Advanced settings, set the "Trust email" toggle button to "On".
- Save the settings.