Whitelisting domains in KYP SSO

Prev

πŸ”‘ How to Whitelist a Domain for KYP SSO in Keycloak

KYP provides the option to create a Single Sign-On (SSO) domain, allowing people from different teams or companies to use the same account across various KYP-related platforms.

To enable this functionality, each customer domain must be whitelisted in the Keycloak configuration settings. These are available on the Keycloak portal at:

<yourdomain>/keycloak

Example:
https://sup.kyp.ai/keycloak


πŸ—‚οΈ Step-by-Step Guide to Whitelist a Domain in KYP SSO

1️⃣ Switch to the KYP Realm

SSO must always be configured within the KYP realm.

  • πŸ”„ In the top-left corner of the Keycloak portal, switch the realm to KYP.

2️⃣ Open Realm Settings

  • βš™οΈ From the left-hand side menu, select Realm settings.


3️⃣ Navigate to the User Profile Tab

  • πŸ‘€ Open the userProfile tab.

  • πŸ“§ Click on Email.

4️⃣ Add a Validation Rule

  • βž• In the Validations section, click addValidator.

  • πŸ” Select Pattern.

5️⃣ Define the Allowed Domains

Use the following regex pattern to whitelist domains:

^[^@]+@(kyp\.ai|gmail\.com|google\.com|)$

⚠️ Note: When saved, Keycloak automatically adds double slashes. Ensure only a single slash is present in your original format.


6️⃣ Add a Custom Error Message (Optional)

  • πŸ“ You can display a custom error message if a user tries to log in with a non-whitelisted domain.

Example:

This domain is not allowed - reach out to support@kyp.ai.

7️⃣ Save the Changes

  • πŸ’Ύ Click Save in the bottom left corner to apply the updated settings.

  • βœ… The new domain restrictions are now active.

πŸŽ‰ You have successfully whitelisted a domain for KYP SSO.


FAQ

What happens if a user tries to log in with a non-whitelisted domain?

They will be blocked from logging in and shown an error message. You can configure a custom error message (e.g., β€œThis domain is not allowed – reach out to support@kyp.ai”) to guide users.

Can I whitelist multiple domains at once?

Yes. Multiple domains can be added within the same regex pattern using the | (pipe) separator.

How can I test if the whitelisting works?

  • Create a test account with a domain that should be allowed and one with a domain that should not be allowed.

  • Attempt to log in with both accounts to verify the configuration.