I have a python application that’s been working fine for a long time that just today started failing with a 401 error when trying to fetch the public key from .well-known/jwks.json.
The error seems to be related to the User-Agent requet header.
“User-Agent: Python-urllib/3.12” - this will cause it to return 401 error.
Is this new behavior? My urllib library has not changed. I verified this using curl and manually overriding the user-agent header - if using “Python-urllib/3.12”, it fails. If I leave it alone and it defaults to “curl/7.81.0”, it works again.
We are sorry for the inconvenience that this issue has provoked. The cause of it should have been a Cloudflare’s incident related to their internal service Global Network.