Recent searches


No recent searches

JWT authentication, no email-address in user-profile



Posted Jul 11, 2022

Hi team,

We are using JWT authentication for end-users in our app. That way they can start chatting with us right away without providing their personal information. (Or so we thought)

However, even when adding the email address to the JWT payload, the email address is not carried over to the Zendesk end-user profile.

    let payload = {
      name: 'Example Person',
      email: 'some@example.com',
      external_id: '123',
      scope: 'user'
    };
    var token = await jwt.sign(payload, 
  'xxxxxxxxREPLACEDxxxxxxxxx',
  { header: { kid: "xxxxxxxxREPLACEDxxxxxxxxx" } });

This works really well and  the enduser does get the little green tick as seen below:

But only the name seems to be added to their profile.

This rings true for the Webwidget and both mobile SDKs.

So at the moment, we are still asking our users for their email addresses via chat. But this is less than perfect. Any idea?

Thanks


1

7

7 comments

image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Cedric! This is actually a known limitation with these APIs at the moment, as we document here. The product team is working on releasing this functionality soon and if you check the last few comments, you can see discussion around this topic there. I'll ping that team to see if they can provide any updates to this.

0


Greg Katechis any news?

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Vinicius! This has been functional in product for some time now…are you experiencing any issues here?

0


Greg Katechis, I can authenticate my end-users on messaging chat (I noticed they don't need to fill the email input when they are authenticated), but they don't have email when ticket is created.





The contact is empty.

0


Greg Katechis, I did the test again, and still the same problem.

Request to my jwt server:


I'm receiving the token:


Login process:



Creating ticket:



User profile:


Empty email.

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

It looks like you are not passing in the `email_verified`attribute, which may be causing this. Take a look at our documentation here and see if that helps!

0


Greg Katechis nice catch, it worked here!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post