Configuring SMTP in Keycloak

keycloak login invitation smtp

Configuring SMTP in Keycloak#

This guide covers configuring an SMTP server in Keycloak, which is a prerequisite for email-based user invitations in AMD Resource Manager.

Prerequisites#

  • Keycloak admin console access — URL, credentials, and realm selection.

  • An SMTP server accessible to your organization that you can integrate with Keycloak and AMD Resource Manager.

Configuring the SMTP server#

Navigate to Realm settings and then to the Email tab. Here you can configure the SMTP server that Keycloak will use to send emails. The settings you need to fill in are:

  • From: The email address that will appear as the sender of the emails sent by Keycloak.

  • Host: The hostname of your SMTP server (e.g., smtp.example.com).

  • Port: The port on which your SMTP server is running (usually 587 for TLS or 465 for SSL).

  • Encryption: Choose the encryption method your SMTP server uses (SSL and/or StartTLS). If your SMTP server does not support encryption, you can select neither, but this is not recommended for production environments.

  • Authentication: Enable this if your SMTP server requires authentication. You will need to provide the username and password for the SMTP server.

    • Username: The username for the SMTP server.

    • Password: The password for the SMTP server.

Once this is done, you can test the configuration by sending a test email to ensure that Keycloak can connect to the SMTP server and send emails successfully. Prior to doing this, ensure that the user you have currently logged in as, in the master realm has an associated email that Keycloak can use to send the test email.

Note: Depending on the strictness of the spam/junk filters, you may need to whitelist the Keycloak server’s IP address or domain in your email server settings to ensure that emails are not marked as spam.

Inviting users#

Once the SMTP server is configured, you can invite users via AMD Resource Manager. This is done by logging into AMD Resource Manager and navigating to the Users tab and clicking on the Invite user button. You can read more about inviting users in the AMD Resource Manager user guide.