Freshchat API responds with "JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted." (any endpoint)

Hi everyone,

I have generated a Freshchat API token following the instructions here: Freshchat

However, when I try to use the token, I get a 400 Bad request response:

{
"success": false,
"error_code": 0,
"error_message": "JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted."
}

CURL command is the same as in the documentation https://developers.freshchat.com/api/#list_all_agents -

curl -X GET   'https://api.freshchat.com/v2/agents?items_per_page=2'   -H 'Authorization: Bearer eyJhbGciOiJSUzI1...' -D -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/1.1 400 Bad Request
Date: Tue, 06 Oct 2020 14:40:30 GMT
Content-Type: application/json
Content-Length: 166
Connection: keep-alive
Server: nginx
x-fw-ratelimiting-managed: false
Strict-Transport-Security: max-age=31536000; includeSubDomains

100   166  100   166    0     0    166      0  0:00:01 --:--:--  0:00:01   332
{"success":false,"error_code":0,"error_message":"JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted."}

Note: www.jwt.io also reports the JWT as having an ‘invalid signature’

Did anyone ever encounter the same issue? Also happens on a colleagues’s newly opened account
Note: I have an open ticket about this (#7761861), just wanted to see if the community had any input :slight_smile:

Best,
Simone

2 Likes

Hi @Simone,
Welcome to the freshworks community :tada:.

May I know in which region is the Freshchat account belongs to? If you are not sure, you can message me with account full domain url. The API endpoint is specific to the region in which the account belongs to.

api.freshchat.com - US
api.eu.freshchat.com - EU
api.in.freshchat.com - IN
api.au.freshchat.com - AU

2 Likes

Hi Mani Deepak Vandrangi,

thanks, I just got a response on the ticket as well.
Indeed the issue was that I had to use api.eu.freshchat.com, didn’t realize there was this specificity.

thanks and best regards,
Simone