Enabling authenticated visitors in the integrated Web Widget

Have more questions? Submit a request

47 Comments

  • Dylan Cunniffe

    Thanks Ramin,

     

    My understanding though is this is only a client-side fix? If a user simply closes their browser and gets logged out of the host app (server-side) there would be no way for us to ensure the customer is also logged out of the widget using the above method.

    Is my understanding correct?

    0
  • Ramin Shokrizadeh

    Hi Dylan,

    In the case of closing the tab, the widget will disconnect the visitor after 15 seconds based on the timeout value and they would need to be authenticated again via the client.

    -Ramin

     

    0
  • Dylan Cunniffe

    Thanks again Ramin,

     

    One more question before I take this to my devs, could you just confirm what is meant by the below comment in the article?

    0
  • Ramin Shokrizadeh

    Hi Dylan,

    That was out of date information in the docs, it has been corrected now. You can use the code sample I provided earlier to logout in the integrated chat experience.

    -Ramin

     

    1
  • Ivan De Jesus

    Hi Ramin,

    Already follow the process on authenticating users, I used jwt.io to generate token and pass it on the callback. Unfotunately web widget still can't recognize user details and add them as visitors. Please help, thanks

     

     

    0
  • Ramin Shokrizadeh

    Hi Ivan,

    Please email chat@zendesk.com to get assistance with your authentication question.

    Thanks,
    Ramin

     

    0
  • Ivan De Jesus

    Hi Ramin,

    Already done with the implementation of on authenticating users. I noticed that to be able to authenticate the user upon login page needs to be reloaded. But we are working on SPA. Can you help?

     

    Thanks,

    Ivan

    0
  • Ramin Shokrizadeh

    Hi Ivan,

    If you are offering chat on the login page and they authenticate into your app, you will want to have the widget load after the authentication. There is no transition phase for a visitor to move from non-authenticated to authenticated in the same session.

    If you load the widget and authenticate in the single page app, it should work assuming you do not destroy the widget on page changes. Optional for single page apps, use the following API to see the visitor path changes in the app: https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#sendVisitorPath

    This can help your agents know where in the app the visitor/customer is currently. 

    Thanks,

    Ramin

    0
  • Vikas Shivananjappa

    Hi Team,

                We are using angular 7 app integrated with zendesk chat as web widget.  The authentication piece of code is getting called on application load(unfortunately we do not have any user details) but not after that.

     

    CODE SAMPLE:

    this.window['zESettings'] = {
    webWidget: {
    authenticate: {
    chat: {
    jwtFn: (callback) => {
    this.apiService.ssoPost(this.zendeskAPIURL, null, null).subscribe((response) => {
    console.log('Response from Zendesk Chat API - Identify', response.zendeskToken);
    callback(response.zendeskToken);
    });
    },
    },
    },
    },
    };

    Appreciate any help on this one?
    0
  • Vikas Shivananjappa

    So with further more investigation, i believe the  above code snippet runs before the chat widget is loaded... However it did not after.

     

    In our case, since the widget is shown on app load(before login), we have no means to authenticate the user. We want to authenticate the user when he logs in and update the chat widget settings accordingly.

     

    Appreciate any help on this regard.

    0
  • Ramin Shokrizadeh

    Hi Vikas,

    Currently, there is no way to transition a non-authenticated visitor to an authenticated visitor. You will need to authenticate the visitor after the login page.

    -Ramin

     

    0
  • Vikas Shivananjappa

    Hi Ramin,

                    Thank you for the response. Does that mean we need to load the chat widget only after the user gets autheticated(after login). If so, then how?

     

     

     

    0
  • Ramin Shokrizadeh

    Hi Vikas,

    In terms of code, the authentication call needs to happen after the widget snippet. So the flow would look like this:

    1. Login page (no widget)
    2. User authenticates on your end
    3. Gets directed to homepage, widget loads and calls the authenticate call with the set user information

    -Ramin

    0
  • vshivananjappa

    Hi Ramin,

                    Ours is a single page app. The zendesk chat web widget is embedded in our index.html file which gets loaded on application load(only one time). 

     

    Hence in the above mentioned scenario,

    How do we suppress the chat widget on login screen

    How do we enable the chat widget once user logs in with authentication details

     

     

    NOTE: I tried to use suppress attribute of zESettings but it did not work.

    0
  • Ramin Shokrizadeh

    Please create a ticket by emailing chat@zendesk.com and we can troubleshoot your issue further from there.

    0
  • Jorge Lage Saguier

    Can we authenticate visitors if we are using the Chat SDK?

    0
  • Barry Carroll

    Hi Jorge,

    You cannot do that currently. We're working on Chat SDK V2, and this is one of the use-cases we'll address there.

    0

Please sign in to leave a comment.

Powered by Zendesk