Not sure why the error is occurring as I have registered the oauth and have even downgraded my authlib version to 0.12.1 and still no fix. The main overarching issue is that I get an internal server error of 500 with the flask app and this jwks_uri showed up as the runtime error.
RuntimeError: Missing "jwks_uri" in metadata for flask and Google authlib
2.9k Views Asked by Ruhan Ponnada At
3
There are 3 best solutions below
1
On
if you are using Google authlib just add server_metadata_url= 'https://accounts.google.com/.well-known/openid-configuration' to the oauth.register it worked for me, For example:
oauth.register(
name="google",
client_id = "your client id",
client_secret= "your client secret"
access_token_url= "https://www.googleapis.com/oauth2/v4/token",
access_token_params=None,
authorize_url= "https://accounts.google.com/o/oauth2/v2/auth",
authorize_params=None,
api_base_url= "https://www.googleapis.com/oauth2/v3/",
client_kwargs= {"scope": "openid email profile"},
server_metadata_url= 'https://accounts.google.com/.well-known/openid-configuration'
)
1
On
this was what worked for me
google = oauth.register(
name='google',
client_id='',
client_secret='',
access_token_url='https://accounts.google.com/o/oauth2/token',
access_token_params=None,
authorize_url='https://accounts.google.com/o/oauth2/auth',
authorize_params=None,
api_base_url='https://www.googleapis.com/oauth2/v1/',
userinfo_endpoint='https://openidconnect.googleapis.com/v1/userinfo',
# This is only needed if using openId to fetch user info
client_kwargs={'scope': 'openid email profile'},
jwks_uri = "https://www.googleapis.com/oauth2/v3/certs"
)
Not sure what your code looks like, but when you register via oauth.register do you have server_metadata_url? Not having server_metadata_url made my app throw the following error:
"AUTH0_DOMAIN" in this instance would be your auth0 domain.
You can scroll through the official tutorial to the section that has a snippet of code similar to the one I have shown above.
https://auth0.com/docs/quickstart/webapp/python/01-login