Third-party Authentication

Cloud Scale’s Authentication component allows you to implement a third-party authentication service of your preference for your Catalyst application. The authorization and validation of the end-user is handled by the third-party service, and the data is passed on to Catalyst.

Note:
  • Since you are implementing a third-party authentication service, it is understood that the security infrastructure of your application is contingent on the efficiency of the third-party service that you have chosen.

  • To enable a third-party authentication in your Catalyst application, you must ensure that you have enabled Public Signup in the console.

When a user is re-directed from a third-party service after being authenticated, their credentials must be passed to an authentication function that you code in Java, Node.js, or Python. The below SDK will use the generated JSON Web Token token (JWT) or custom token to authenticate the end-user. You must incorporate this code into your web client logic, to enable third-party authentication.

Authenticate User Using JWT

This is a sample code that uses a JWT to authenticate the user is given below.

    
copy
<script src="https://static.zohocdn.com/catalyst/sdk/js/4.0.0/catalystWebSDK.js"></script> <script src="/__catalyst/sdk/init.js"></script> <script> catalyst.auth.signinWithJwt(getCustomTokenCallback); function getCustomTokenCallback(){ return fetch("{domain}/server/{function_name}/execute") //function url to get the generated custom token .then(resp => resp.json() .then(resp => { return new Promise((resolve, reject) => { resolve({ client_id : "********", scopes : "ZOHOCATALYST.tables.rows.ALL,ZOHOCATALYST.cache.READ", jwt_token : "*********" }); }); })) } </script>
Note: The custom server token will have to be generated every single time the user logs in to your application using a third-party authentication service.

Last Updated 2023-11-14 13:20:49 +0530 +0530

RELATED LINKS

Authentication