Setting up user authentication for messaging



image avatar

Aimee Spanier

Zendesk Documentation Team

Edited Mar 19, 2025


3

160

167 comments

Es posible aplicar la identificacion por Whatsapp?

0


zE('messenger', 'loginUser', function (callback) {
  callback(token);
})
I get 401 authentication error, and I want to know how to catch this error.  I use try/catch for callback(token), but it's not work.
Thanks

0


Hi, 

I need guidance on managing the login between the web login and the Zendesk end-user messaging login to keep them both synchronized.

Typically, I set the web session and JWT token to expire at the same time. However, there may be additional scenarios as follows:

  1. If the user logs out from the web, it should also force a logout on Zendesk messaging. (In this case, the user did not click the logout button but closed the screen, and the web session expired on its own).
  2. If the JWT token expires but the user is still active on the web, I want to create a new JWT token. When the JWT token expires, is there an event that can detect the expiration of the JWT token so that the web can call to create a new JWT token?

0


How does the web side pass JWT? Is there a corresponding API?

0


Hola muy buenas Frank.
 
En relación a tu consulta, la opción de "Talk" en el widget está presente en el Web Widget (Classic), y no en la Mensajería, solo para aclarar ese punto.
Para tener una funcionalidad similar, deberían utilizar el API de Talk: Voice API in messaging quick start
 
Ahora en cuanto a la pregunta en la autenticación, y si estás utilizando WW (Classic), al momento de solicitar un callback aparecerá el formulario para completar y no puede modificarse. Por lo que la información la tomará de allí. Y si se trata de un cliente llamando, esto sería una llamada entrante en Talk, por lo que no habría una relación entre la autenticación del Widget y una llamada en la que se tiene visibilidad únicamente del número de teléfono.
 
Si tuvieras alguna consulta adicional sobre este tema, te sugiero crear una conversación con el bot en nuestro Centro de ayuda para crear un ticket de soporte y poder evaluar mas en detalle.
 
Un saludo y que tengas excelente comienzo de semana.

0


Hola, buenas, me gustaria saber si existe la posibilidad de cuando se configure la autenticacion de usuario para el web widget esto permite que se autentiquen tamb para llamada y no solamente para mensajeria. 
Ejemplo: tengo un web widget configurado con mensajeria, chat y llamadas, si el usuario se autentica en el web widget, esta autenticacion me funciona para identificar quien me llama por la linea digital que tengo configurada?.
Si no es asi, podrian darme algunas alternativas, ya sean aplicaciones de terceros o quizas alguna idea respecto a esto.
Gracias y espero su respuesta.

 

2


Does anyone have an example of authentication with nextjs? 
Today the use is script, ex

<script

id='ze-snippet'

src='https://static.zdassets.com/ekr/snippet.js?key=123456'

/>

0


The last paragraph doesn't match what we're seeing in production, and seems to contradict itself:

Zendesk uses the external ID as the primary identifier, with email addresses being used only if no matches are found for the external ID. 

So we expect that if we send the `external_id` and `email` in the JWT, and the `external_id` is not matched to a user, but the `email` is matched to a user,  that user is authenticated. However, we observe some vastly different outcomes depending on whether we're testing in Sandbox vs. Prod, or whether the user has a verified or unverified email address, or whether we include `email_verified` in the JWT, but there is no scenario we've seen where a user is authenticated as an existing user when the `email` matches and when the `external_id` doesn't. We see instead, a new user is created, or the login request fails. The latter outcome seems to agree with the next sentence following the one above:

If, however, an email address presented in a JWT is already associated with a different external ID, Zendesk rejects the JWT and the end user's login attempt fails.*

Which is essentially saying “if the external_ids don't match, but the emails do, we authenticate the user, except if the external ids don't match”. So my question would be under what circumstances exactly would the `email` be used to authenticate the user as a fallback when the external ids don't match?

* this was not the case in sandbox testing, where we never saw logins fail, and a new user was created each time, which was seriously confusing why sandbox would behave different than prod. The results were also different in that depending on the user's email verification status, the newly created user would inherit the email, and multiple results would be returned from the API search endpoint when querying on the email. This all made testing and implementation incredibly difficult. 

4


Este processo precisa ser implementado para realizar a autenticação do usuário: Documentação Zendesk
 
A autenticação do Centro de Ajuda e a autenticação do widget são dois fluxos diferentes.
 
Como não há outra maneira nativa de fazer isso no momento, o processo de autenticação JWT ainda precisa ser implementado como seria para qualquer site externo.

0


Boa tarde. 

Porquê o BOT não consegue identificar o usuário logado no GUIDE Zendesk e criar o ticket associado ao email desse usuário ? 

1


Sign in to leave a comment.