Accessing Zoho via Keycloak using SAML
By configuring SAML based SSO with Keycloak, you can allow users sign in to Zoho using their Keycloak credentials.
A. Setup Keycloak as IdP
- Sign in to the Keycloak admin console as an admin.
- Click Manage realms in the left menu.
- Select the realm where you want to setup Zoho integration If you don't have one, create a new realm.
- In a new tab, sign in to accounts.zoho.com.
- Go to the Organization tab from the left menu and select SAML Authentication.
Click Download Metadata.
- Open the metadata file using a browser or a text editor.

- From the metadata file, copy and save the following:
- Entity ID
- SingleLogoutService URL
- AssertionConsumerService URL(ACS).
- Return to Keycloak admin console for configuration.
- Navigate to Clients in the left menu and click Create client.

- In the General settings section,
- Select SAML in the Client type field.
- Enter the entityID in the Client ID field.
- Fill in the Name and Description.
- Click Next.

- In the Login settings section,
- Paste the ACS URL in the Valid redirect URIs field.
- Paste the SingleLogoutService URL in the Valid post logout redirect URIs.
- Paste the ACS URL in the Home URL, but replace signin/samlsp to samlauthrequest.
- Click Save.

- Scroll down to the SAML capabilities section,and do the following:
- Select email as the Name ID format.
- Enable Force name ID format.

- Scroll down to the Signature and Encryption section, and do the following:
- Enable Sign documents.
- Enable Sign assertions.
- Select RSA_SHA256 for Signature algorithm.
- Select NONE for SAML signature key name.
- Select EXCLUSIVE for Canonicalization method.

- Enable Force channel logout in the Logout settings section.
- Click Save.
- Go to the Keys tab and disable Client signature required.

- Click Yes to disable the client signature in the confirmation box that shows up.
- Go to the Advanced tab.
- Under the Fine Grain SAML Endpoint Configuration section, paste the SingleLogoutService URL (from the Zoho metadata file) in the Logout service POST Binding URL.

- Click Save.
- In Keycloak, go to Realm settings in the left menu under Configure.
- Scroll down and click SAML 2.0 Identity Provider Metadata next to Endpoints.

- Copy and save the following details from the IdPmetadata XML file:
- The X509Certificate details enclosed inside the <ds : X509Certificate> </ds : X509Certificate>
- SingleLogoutServiceURL (optional)
- SingleSignOnService URL

- Click Save.
- Return to the SAML Authentication page in your Zoho account.
- Fill in the following fields:
- Paste the SingleSignOnService in the Sign-in URL field.
- Paste the SingleLogoutService in the Sign-out URL field.
- Paste the X509Certificate details in the X.509 Certificate field.
- Click Submit.
Test the SAML configuration
You can verify that the SAML configuration is working correctly by following these steps as a user in Keycloak:
SP-initiated flow:
- Go to your Zoho sign-in page.
- Enter the email address, then click Next.
- Select Sign in using SAML. You will be redirected to Keycloak for authentication.
- Enter your Keycloak credentials and click Sign In. You will be redirected back to Zoho and will be signed in.
IdP-initiated flow:
1. Sign in to Keycloak.
2. Go to Applications.
3. Click Proceed in Review the sign-in URL page. You will be redirected to Zoho and will be signed in.