It has been few days in which I'm struggling to figure out the visitor authentication of the chat - without any success :(
Here is my code please help!!
Server (Ruby)

The Password I use is from the shared secret section in here:
https://lionwheel.zendesk.com/chat/agent#widget/widget_security
Here is the token I get back to the JS:

Seems that although the JWT looks great, I get http 400 error: "failed to validate claims" error:

Please help!





Upon checking the screenshots, I am able to see that you are encoding the shared secret in base64 encode.
Our JWT shared secret is NOT base64 encoded. I've noticed that many JWT libraries assume that the shared secret is base64 encoded, and the signature they end up generating is invalid. Can you see if that's the case with the library you're using? Also, you can just treat it as string.
For more info, please visit: Generating a new shared secret
I hope this help. Please open a support ticket, in case you need further assistance, to review this internally.
Sincerely,