Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Zendesk authentication

I need to display user's name in the in the zendesk chat ( for the agents), I'm using the code provided by zendesk:

window.zESettings = {
 webWidget: {
   authenticate: {
     chat: {
       jwtFn: function(callback) { 
         fetch('JWT_TOKEN_ENDPOINT').then(function(res) {
            res.text().then(function(jwt) {
             callback(jwt);
            });
          });
        }
      } 
    }
  }
};

and jwt token is:

var payload = {
  name: '#{customerName}',
  email: '#{customerEmail}',
  iat: #{timestamp},
  external_id: '#{externalId}'
};
var token = jwt.sign(payload, '#{yourSecret}');

The code doesn't work, I don't get errors but user name is not visible. Zendesk documentation doesn't provide any valuable information, has anyone integrated Zendesk in their app? What am I doing wrong? any help and suggestion is greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'm running into some issues with a similar implementation. In my situation I am using the same Javascript to authenticate the chat webWidget. I have my JWT_TOKEN_ENDPOINT defined in a rails controller (RoR) which uses the ruby-jwt gem to generate the token.

In my case though, my browser is showing the error message:

Zendesk Chat Web SDK: Error: init: Failed to verify token: jwt verification error

Are you seeing any browser console errors to suggest what might be the issue?

Do you have your endpoint setup to generate the JWT token?

Are you passing a valid shared secret in the jwt.sign(payload, "#{youSecret}") var assignment?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!