Enable Authentication for visitors in Web Widget

5 Comments

  • Daniel Aron
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    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
  • Brian Broerman
    Comment actions Permalink

    Hi Daniel, I am running into the same issue as described above.

    Using an SPA Framework (such as angular) means that we need to be able to 'refresh' the authentication method for the web widget / chat AFTER a user logs in, but without a page reload. Is this possible?

    0
  • Daniel Aron
    Comment actions Permalink

    Hi Brian, yes this is now possible. You can now refresh the authentication method for an SPA by using the jwtFn, similar to the code snippet here.

    Note: The code in the example would authenticate with both chat and help center.

    0

Please sign in to leave a comment.

Powered by Zendesk