SSO for Customer Portal

Single Sign On for your users easily login to the customer portal.

Riya Handique avatar
Written by Riya Handique
Updated over a week ago

SSO for customer portal

SSO will enable your users to sign up in to the customer portal through your website. This will make the process much smoother and comfortable by using the same login credentials they will have to use for your website.

Steps to enable SSO for your customer portal:

  1. Inside the app, go to Workspace Settings -> Customer Portal -> Control tab and then scroll down to SSO.

  2. Click on Setup SSO. The user needs to provide a redirect URL. This will be a login URL for your application.

  3. The user will be provided with 3 different keys namely: private key, client id, and auth key.

    1. Client Id - This will be used in combination with auth key for validation of the user.

    2. Auth Key - This will be used for identifying the workspace to which the user belongs.

  4. The user needs to add the below function at the server side. This function will generate a JWT token containing user information. The function uses the private key from customer portal settings.

  5. The SSO token will be generated if the user is successfully authenticated in your application.

    const jwt = require('jsonwebtoken'); 

    function createSSOToken(user) { const privateKey = privateKey;

    // Note: here, [uuid] is the id of ZEDA customer custom field you want to push with company details, so [uuid] will be replaced with the id (ex. 'dcf4b862-0dbf-40bc-b5b5-8ed2ed81d37e').

    // You can find it in settings -> customer portal -> control -> SSO -> Customer Custom Fields ({{unique-workspace}}/workspace-settings/customer-portal/control) (Here, unique-workspace is your workspace's unique name). var userData = { picture: user.avatarURL, email:, id:, name:, company: {name:, domain: company.domain, [uuid]: customField.value, [uuid]: customField.value, ...}, contact: {name:, email:} };

    return jwt.sign(userData, privateKey, { algorithm: 'HS256' }); }

  6. Once the SSO token is generated, the user will be redirected back to Zeda using the below function. This redirection will be done from the client side of your application.

    function getRedirectURL(ssoToken) { 

    const clientId = '/* Enter your client id copied by the dashboard settings of the customer portal */';

    const authKey = '/* Enter your workspace auth key copied by the dashboard settings of the customer portal */';

    return ( '' + ssoToken + '&authKey=' + authKey + '&clientId=' + clientId ); }
    // client needs to call this function for redirecting the user to SSO Backend
    var redirectURL = getRedirectURL(ssoToken);

    if (redirectURL) {

  7. If steps 4 & 5 are done, the user needs to click on Verify & Activate.

  8. The workspace admin (current user) needs to login in their application using the same login URL for authenticating the login URL.

  9. Zeda will append a query parameter in the login URL: loginType=sso_zeda.

  10. This query parameter will help your application in identifying that the request is coming from the Zeda Customer Portal and the private key provided by Zeda needs to be used for generating the SSO token.

  11. Once the workspace admin's login is successful and verification is done, the SSO setup for the Customer Portal will be completed.

  12. By default, the toggle for SSO will be enabled.

  13. The user can later choose to enable or disable the SSO from the settings.

Please feel free to reach out to us here in case of any issues.

Did this answer your question?