Enable Authentication for visitors in Web Widget

3 Comments

  • Daniel Aron

    Hi Vikas, we don't listen for window changes, instead you will need to call updateSettings when a route has changed or the page is refreshed. 

    0
  • vshivananjappa

    Hi Daniel,

                     We are using updateSettings to authenticate the user after he logs in . Unfortunately the jwtFn callback does not get called on updateSettings.

    I see the color is changed which confirms that the updateSettings is being run.

     

    Here is the sample code:

    this.zE('webWidget', 'updateSettings', {
    webWidget: {
    color: {theme: '#FFFF00'},
    authenticate: {
    jwt: jwtToken,
    chat: {
    suppress: false,
    jwtFn: function (callback) {
    this.apiService.ssoPost(this.zendeskAPIURL, null, null).subscribe((response) => {
    console.log('Response from Zendesk Chat API - Identify', response.zendeskToken);
    console.log('Call back', callback);
    callback(jwtToken);
    });
    },
    },
    },
    },
    });
    0
  • Daniel Aron

    Hi Vikas, apologies I may have misunderstood your initial question. Correct, you can't use updateSettings in combination with authenticate to renew the JWT. There is an existing way to renew the JWT for Chat authentication which I believe you're aware of and is described in this document. We plan to provide a similar solution to renew the JWT for Support authentication, i'll provide an update here when we have an ETA.

    0

Please sign in to leave a comment.

Powered by Zendesk