JwksError: Bad Request with jwks-rsa

Problem statement

JwksError: Bad Request with jwks-rsa

Troubleshooting

Set the environment variable DEBUG=jwks and check the output to see the exact JWKS URL being called.

Solution

Possible causes:

  • WAF intercepting requests
  • Misconfiguration of JWKS URL such as trailing whitespace