Recent searches


No recent searches

Authenticating end users for messaging



image avatar

Aimee Spanier

Zendesk Documentation Team

Edited Dec 23, 2024


3

158

158 comments

Hey, check out this app: https://www.zendesk.com/marketplace/apps/support/1066145/messaging-and-help-center-authentication . It helps authenticate Help Center users on the messaging widget. Highly recommended! :)

 

0


Chris Batt Did you ever get an answer to this? I am seeing the same. It's almost like I want to add more logic - get the user via email, and if they don't have an external id, then create one using their user id, then send the JWT request. I think the issue is it sees there' no external_id, but can't use the email since it's already in use, and doesn't just assume the one with the correct email address is correct.

0


Hi,

We have build our backend service that will generate the JWT tokens. We have followed the instructions as per the steps in this document. 

We generate a JWT token with the required claims and then use the token in Postman as a Bearer token to test it. But we keep on receiving the status code 401. 

Is there anything else we should have configured on Zendesk apart from the Signing key in the Messaging section?

Or should the issuer and audience properties of the JWT token be specific values?

0


Pierre To properly encode, you need the algorithm of H256, the correct kid (from Account;end user security), and type of JWT. The payload really just needs scope=user and external_id, but I use email, name, and verified. 

I recommend using one of the JWT encoder/decoders and hardcode the value into the ZE call until you get it working. You might be missing a parm to encode in your encoder. I found I was getting 401 Login issues as I was using the wrong kid to encode.

0


John Witt, thanks for you response. 

We did get he web widget to work by using the backend service. We use the JWT token as described, but still the bot does not return any useful articles. Only when we make our articles public it works as it should. 

Is there a setting somewhere in Zendesk that will allow the bot to return articles without us having to make all our articles public facing?

0


My articles were private, and the only way around this is to use email, external id, and email_verified=true. However, if you don't pre-populate the external id before doing this, it will create a new user (you'll need to merge or delete the other one).

0


Thanks John Witt 

Just to make sure I understand it correctly. 

Can I pre-populate the external id in zendesk or do I need to do this using an API?

My assumption is that the bot can automatically recommend articles based on the questions the end user asks. Or do we still need to pre-configure recommended articles for certain questions within the bot?

Thanks again for your help.

0


Pierre I have found that Zendesk requires an email_verified status to see non-public articles. I send the userid of the current user ($AJAX user.me) as the external_id, email_verified true, and the email to create the token. The problem with this is it will always create a new user since external_id doesn't exists, so one workaround is to prepopulate every user's external_id with their user_id before testing Messaging. I prefer make.com and powerautomate, but I assume any integration tool or ZIS could do it. Worst case is you have two users and need to merge.

0


Please sign in to leave a comment.