Hi Team,
We have integrated web widget(chat) in our Angular 7 app. We did go through the mentioned article https://chat.zendesk.com/hc/en-us/articles/360001301627-Enabling-authenticated-visitors-in-the-Web-Widget about how to enable authentication for visitors.
ISSUE: When the below code snippet is run on APPLICATION PAGE LOAD it runs fine, generates the token and authenticates the user.This tells me that the code sample works fine.
However during route changes/page is refreshed, the below code snippet is not executed. The jwtFn function is never called. We have placed this in the root component which gets fired on every route change. Please suggest.
CODE SNIPPET Used for authentication:
this.window['zESettings'] = {
webWidget: {
authenticate: {
chat: {
jwtFn: (callback) => {
this.apiService.ssoPost(this.zendeskAPIURL, null, null).subscribe((response) => {
console.log('Response from Zendesk Chat API', response.zendeskToken);
callback(response.zendeskToken);
});
},
},
},
},
};
Hi Christian,
If an external ID is supplied in the JWT request, we use that to identify the user, unless the option 'Allow update of external IDs' is enabled in Zendesk, in which case, we'll use the email address instead. More information here: Anatomy of a JWT request