Enabling authenticated visitors in the integrated Web Widget (early access) Follow

Comments

16 comments

  • Avatar
    Josh Cope

    Hi, any idea if your using this would you also still want to use zE.identify https://developer.zendesk.com/embeddables/docs/widget/api#ze.identify

    or would this cover that now?

    also it seems like setPhone would still be set using the zopim livechat api? as this is only doing name and email https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#setPhone

    also I submitted a request for the Web Widget Integrated Chat Experience EAP and was wondering if I could get access

    Thanks

  • Avatar
    Ramin Shokrizadeh

    Hi Josh,

    You would still want to use zE.identify for the other channels in the Web Widget, like contact form/help center. If you only care about setting the information for the Chat product, you can just use this.

    Currently, authenticated visitors does not require phone number as a authenticated field and you would need to set it using setPhone for now.

    For the Web Widget integrated chat experience EAP, the PM (Dan) should get in touch with you shortly.

    Thanks,

    Ramin

  • Avatar
    Zac

    Quick question - what happens if you try to authenticate a visitor who has some kind of credential on your website but doesn't yet exist in your Zendesk?

  • Avatar
    Ramin Shokrizadeh

    Hey Zac,

    Using chat authentication with the Web Widget won't create a new user until a ticket gets created from the chat/offline message. This behaviour is the same for non-authenticated visitors also.

    If you use zE.identify to authenticate the non-Chat related channels in the Web Widget, it will create a new user if there isn't one that matched the email address in your account.

    You can learn more about this Web Widget API here:

    https://developer.zendesk.com/embeddables/docs/widget/api#ze.identify

    -Ramin 

  • Avatar
    Jonathan Fornari

    Hello, I followed this article's tutorial as stated, but my function jwtFn never gets called or executed. I'm also passing other stuff on settings like colour change just to make sure it is right, and the colors indeed changed on the widget.

    Any help?

  • Avatar
    Ramin Shokrizadeh

    Hi Jonathan,

    Can you email the issue you are experiencing with the code snippet using the Javascript APIs to chat@zendesk.com?

    We can have a look and see what could be causing the issue.

    Cheers,

    Ramin

  • Avatar
    Aman Kumar Jain

    Hi,

    The jwtFn is never executed. Screenshot below:

     

    This is a blocker, any help?

     
  • Avatar
    Steve Shutts (Admin)

    I have zero experience with website coding and java scripts. When will this be an automatic part of chat? When a user logs into the helpcenter and has the chat widget available, they should automatically be logged into the widget. currently, we are having to ask them to log in yet again, even though they just did. seems counter intuitive. The chat widget should just carry over the user's name and email from the helpcents interface.

    Thanks,

    Steve

  • Avatar
    Ramin Shokrizadeh

    Hi Steve,

    Today, the name and email information are pre-filled for customers who are logged into help center but they are not authenticated.

    Authenticating visitors for now will require additional code and you will need to get assistance or a contractor to help you with that work.

    -Ramin

  • Avatar
    Brian Duerring

    Quick note to hopefully save users time and frustration:

    The fetch method defined in this article (see below), does not work with Safari. 

     fetch('JWT_TOKEN_ENDPOINT').then(function(res) {

    When utilized, it returns the following error int he console:
    The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 303.)

    Our endpoint was returning http code 200 with the JWT as plain text and worked fine with Chrome, Firefox and IE.  

    We were able to resolve by replacing the fetch statement with getJSON and updating our endpoint to output JSON with an array (in our case sucess (boolen) and jwt (string).  This resolved the issue on Safari and works with every other browser we've tested as well.  

    Here's the updated code:

    window.zESettings = {
    webWidget: {
    authenticate: {
    chat: {
    jwtFn: function(callback) {
    $.getJSON('JWT_TOKEN_ENDPOINT', function (data) {
    if( data.success ){
    callback(data.jwt);
    }
    });
    }
    }
    }
    }
    };
  • Avatar
    Aman Kumar Jain

    Hi Ramin and Brain,

    We still have a problem. "fetch" will be executed only when jwtFn is executed. In our case even jwtFn is not being executed.

  • Avatar
    Jun Yi Hee

    Hi Brian and Aman,

    Brian:

    I am not sure why you are having issues with Safari specifically, but it looks like the JWT_TOKEN_ENDPOINT in your code is expected to return a JSON payload.

    In that case, you can still use fetch by replacing res.text() with res.json() in the example code above.

    fetch('JWT_TOKEN_ENDPOINT').then(function(res) {
    res.json().then(function(data) {
    if (data.success) callback(data.jwt);
    });
    });

     

    Aman: I have replied to you separately in an email.

    Thank you,

    Jun Yi

  • Avatar
    Brian Duerring

    Jun Yi,


    Thanks for the heads-up regarding the res.json() option to set the handler for a JSON payload.  Unfortunately, Safari failed with the res.text() option when the endpoint was returning plain-text.  Only the move to AJAX utilizing getJson() resolved the issue on Safari.  For reference the version of Safari is below if you would like to confirm / replicate.

  • Avatar
    Hayya Husna

    Hi Ramin, 

    This is Hayya again,

    I have added this code but it's still not working, the jwtFn is never executed.

     

  • Avatar
    Jeffrey van der Meer

    We have the same problem as Hayya. The jwtFn function is never executed. How to proceed?

  • Avatar
    Ramin Shokrizadeh

    @Hayya @Jeffrey you need to be part of the integrated Chat experience EAP for the code to work. It is currently not turned on for your accounts.

    Please register for the EAP here: https://support.zendesk.com/hc/en-us/articles/360001015607-Announcing-Web-Widget-Integrated-Chat-Experience-EAP

     

Please sign in to leave a comment.

Powered by Zendesk