Flask sample app login fails: Missing jwks_uri in metadata

Hi everyone,

I am new to Auth0 and I have been reading various docs and tutorials. I had no problems with the FastAPI tutorial, but I’m stuck in the Flask tutorial. Here’s what I did:

  • Downloaded the example project from the GitHub link at Auth0 Python SDK Quickstarts: Login
  • Created a regular web application in my Auth0 dashboard and configured the callback and logout URLs (localhost)
  • Installed Flask and all dependencies
  • Renamed .env.example to .env
  • Updated .env with my app’s client_id, domain, client_secret and more
  • Ran Flask locally on port 3000 and visited localhost:3000

I can see the homepage and the login button, but when I press login I get the following error:

  "message": "Missing \"jwks_uri\" in metadata"

I guess the app can’t find the JSON Web Key Set? I know where I can find that URL in my Auth0 dashboard, but where do I add it in the sample app?

Thanks in advance for your help.



Hi @Calybyte,

Welcome to the Auth0 Community!

First, could you please clarify the version of the authlib library that you are using?

If you’re using an older version, I recommend updating to authlib version 0.15.5 and see if that resolves your issue: pip install --upgrade authlib

There is also a related Github issue that has suggested a workaround to this issue.

Additionally, it may be worth it to try going to the Auth0 Python SDK Quickstarts: Login, logging in, and downloading the sample directly.

Doing this will automatically populate your environment variables, and you can select the same application which has already configured the http://localhost:3000/callback URLs.

When I tested this earlier, that was the method I took and did not have issues logging in.

If all these workarounds still did not resolve your problem, I recommend opening an issue on Github for further support.

Please let me know if there’s anything else I can do to help.

Thank you.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.