Generate a Custom Server Token
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.
- 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. This function must include the Catalyst server-side logic to generate a custom server token, which will then be passed to the Web SDK incorporated in the client code.
A sample code to generate a custom server token is given below:
ZCCustomTokenDetails customTokenDetails = ZCCustomTokenDetails.getInstance();
ZCCustomTokenUserDetails tokenUserDetails = ZCCustomTokenUserDetails.getInstance();
//Set token user details
tokenUserDetails.setEmailId("emma@zylker.com");
tokenUserDetails.setFirstName("Amelia");
tokenUserDetails.setLastName("Burrows");
tokenUserDetails.setRoleName("App Admin");
customTokenDetails.setUserDetails(tokenUserDetails);
ZCCustomTokenResponse customTokenResp = ZCUser.getInstance().generateCustomToken(customTokenDetails);
You can now pass this token to the client logic as explained in this Web SDK help page.
Last Updated 2023-09-03 01:06:41 +0530 IST
Yes
No
Send your feedback to us