lepture / authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
https://authlib.org/
BSD 3-Clause "New" or "Revised" License
4.49k stars 448 forks source link

TypeError: __init__() got an unexpected keyword argument 'jwks_uri' #546

Closed AleksSpace closed 1 year ago

AleksSpace commented 1 year ago

Hello! I am trying to set up authentication using google in my project. Registered my app with google. I found an example in the documentation:

OAUTH_PROVIDERS = [
    {
        "name": "google",
        "icon": "fa-google",
        "token_key": "access_token",
        "remote_app": {
            "consumer_key": CONSUMER_KEY,
            "consumer_secret": CONSUMER_SECRET,
            "base_url": "https://www.googleapis.com/oauth2/v2/",
            "request_token_params": {"scope": "email profile"},
            "request_token_url": None,
            "access_token_url": "https://accounts.google.com/o/oauth2/token",
            "authorize_url": "https://accounts.google.com/o/oauth2/auth",
            "jwks_uri": "https://www.googleapis.com/oauth2/v3/certs",
        },
    },
]

But when I go to the authorization page, I get an error message:

Traceback (most recent call last):
File "/opt/project/superset/__init__.py", line 260, in <module>
     update_perms=utils.get_update_perms_flag(),
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/base.py", line 135, in __init__
     self.init_app(app, session)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/base.py", line 156, in init_app
     self.sm = self.security_manager_class(self)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/sqla/manager.py", line 39, in __init__
     super(SecurityManager, self).__init__(appbuilder)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/manager.py", line 201, in __init__
     obj_provider = self.oauth.remote_app(provider_name, **_provider['remote_app'])
File "/usr/local/lib/python3.6/site-packages/flask_oauthlib/client.py", line 78, in remote_app
     remote = OAuthRemoteApp(self, name, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'jwks_uri'

I can't understand what's the matter, because the example is from the documentation. Please help me solve this problem.

lepture commented 1 year ago

Hi, this package is authlib not Flask-OAuthlib.