Greetings,
I have zendesk chat phase 4, so I looked in this document how to authenticate my user:
https://support.zendesk.com/hc/en-us/articles/360022185594#topic_n3q_cvq_4fb
In JavaScript, I wrote:
var webWidget = {};
webWidget.authenticate = {
chat: {
jwtFn: function(callback) {
fetch("…/GetZendeskJwtToken”).then(function(res) {
res.text().then(function(jwt) {
callback(jwt);
});
});
}
}
};
window.zESettings = {
webWidget: webWidget
};
And in the endpoint (C# .NET) I wrote:
[HttpGet]
public string GetZendeskJwtToken()
{
var payload = new JwtPayload // just a test payload
{
{"name", "test"},
{ "email", "a@a.com"},
{ "external_id", 1 },
{ "iat", DateTimeOffset.Now.ToUnixTimeSeconds()}
};
var sharedSecret = "..."; // the shared secret I generated
var header = new JwtHeader(credentials);
var secToken = new JwtSecurityToken(header, payload);
var handler = new JwtSecurityTokenHandler();
var tokenString = handler.WriteToken(secToken);
return tokenString;
}
However, although JavaScript gets the encrypted token from the endpoint,
When it sends it to the callback:
https://id.zopim.com/authenticated/web/jwt
I get an error:
“failed to validate claims”
What’s the problem? I did as instructed.
Looking forward to your reply,
Alon.
Hey Maximilian,
It looks like you also have a ticket open with us regarding this issue. Our Customer Care team will follow up with you to troubleshoot further.
Thanks for bringing this to our attention!