Wrong generated token in production, impossible to fetch data by API?

  • Node.js version: 20.10.0
  • NPM version: yarn 1.22.21
  • Strapi version: 4.22.1
  • Database: sqlite
  • Is your project Javascript or Typescript: Typescript

Fetching data using the API doesn’t work in an AzureWeb App using the same config as localhost because the JWT token is invalid, but valid in localhost.

Passing the generated token in production using the API should get the results, but we have a 401 error code. A generated token in localhost works. The steps are the same.

{
“code”: 401,
“message”: “IDX12741: JWT must have three segments (JWS) or five segments (JWE).”
}

Is it something I’m missing or it’s a bug?

This topic has been created from a Discord post (1226995294756143204) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

That looks like an error thrown by the Azure WAF and not Strapi itself, it’s entirely unrelated to us.

oh interesting. Thanks, I’ll take a look!

It was a WAF problem, thanks!

your welcome, we don’t give those error codes so as soon as I saw it I knew it wasn’t us lol