π 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.