Recent searches


No recent searches

Set JWT token for Chat SDK

Answered


Posted Mar 28, 2021

hi all! Is there anybody who can help me with integrating zendesk chat sdk using JWT token authorization? 

We have set up the next step:

  1. Up and run backend on node js according to documentation. https://develop.zendesk.com/hc/en-us/articles/360052354433-Enabling-authenticated-users-with-the-Chat-SDK
  2. On backed we used shared secret from here chat/agent#widget/widget_security for sign response . Is this the correct jwt token for authorize customers from mobile SDK chat? Below an example of return value on our backend
  3. jwt.sign(payload, secret)
  4. Also, we updated iOS and android native library and got the correct response from our service with identity and secret. Please, check my last commit here
    https://github.com/tarasywe/react-native-zendesk-chat

    Meanwhile, i don’t see a checkbox icon near the customer name, as on the example in docs. Does zendesk return any value and how to debug the response from Zendesk if methods below is successful or not?
    [ZDKChat.instance setIdentityWithAuthenticator:authenticator]; 

    and

    Chat.INSTANCE.setIdentity(jwtAuth);

1

1

1 comment

image avatar

Ekaterina Sumolaynina

Zendesk Customer Care

Hi Taras,

The easiest way to test out your JWT endpoint would be by setting JWT authorization on Web Widget as Zendesk uses the same process for JWT for both SDK and Widget.

You can learn how to do it here:
https://support.zendesk.com/hc/en-us/articles/360022185594-Enabling-authenticated-visitors-in-the-integrated-Web-Widget

Widget is very easy to test out as you can just place the code on https://jsfiddle.net/ and see how it works.

Once you test it out, you can implement JWT on SDK without worrying if the endpoint and content of JWT is correct.

Regarding point 4: unfortunately, we don't troubleshoot wrapped application. You can use our Sample app and try to reproduce the issue on it:

iOS: https://github.com/zendesk/zendesk_sdk_ios
Android: https://github.com/zendesk/android_sdk_demo_apps

You can use logger to debug the sample app:
iOS: https://developer.zendesk.com/embeddables/docs/ios_support_sdk/debug
Android: https://developer.zendesk.com/embeddables/docs/android-support-sdk/debug

I hope this helps!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post