code23rus opened a new issue #17401: URL: https://github.com/apache/superset/issues/17401
I want to set up OAuth2 authorization, but it not work. #### How to reproduce the bug 1. Install superset according to the instructions: https://superset.apache.org/docs/installation/installing-superset-using-docker-compose 2. According documentation https://superset.apache.org/docs/installation/configuring-superset add the lines to the end of the superset_config.py file: `AUTH_TYPE = AUTH_OAUTH OAUTH_PROVIDERS = [ { 'name':'egaSSO', 'token_key':'access_token', # Name of the token in the response of access_token_url 'icon':'fa-address-card', # Icon for the provider 'remote_app': { 'client_id':'myClientId', # Client Id (Identify Superset application) 'client_secret':'MySecret', # Secret for this Client Id (Identify Superset application) 'client_kwargs':{ 'scope': 'read' # Scope for the Authorization }, 'access_token_method':'POST', # HTTP Method to call access_token_url 'access_token_params':{ # Additional parameters for calls to access_token_url 'client_id':'myClientId' }, 'access_token_headers':{ # Additional headers for calls to access_token_url 'Authorization': 'Basic Base64EncodedClientIdAndSecret' }, 'api_base_url':'https://myAuthorizationServer/oauth2AuthorizationServer/', 'access_token_url':'https://myAuthorizationServer/oauth2AuthorizationServer/token', 'authorize_url':'https://myAuthorizationServer/oauth2AuthorizationServer/authorize' } } ] # Will allow user self registration, allowing to create Flask users from Authorized User AUTH_USER_REGISTRATION = True # The default user self registration role AUTH_USER_REGISTRATION_ROLE = "Public"` 3. Restart docker-compose containers 4. See error `superset_app | NameError: name 'AUTH_OAUTH' is not defined superset_app | Failed to create app superset_app | Traceback (most recent call last): superset_app | File "/app/superset/app.py", line 34, in create_app superset_app | app.config.from_object(config_module) superset_app | File "/usr/local/lib/python3.8/site-packages/flask/config.py", line 174, in from_object superset_app | obj = import_string(obj) superset_app | File "/usr/local/lib/python3.8/site-packages/werkzeug/utils.py", line 568, in import_string superset_app | __import__(import_name) superset_app | File "/app/superset/config.py", line 1303, in <module> superset_app | import superset_config # pylint: disable=import-error superset_app | File "/app/docker/pythonpath_dev/superset_config.py", line 116, in <module> superset_app | AUTH_TYPE = AUTH_OAUTH superset_app | NameError: name 'AUTH_OAUTH' is not defined superset_app | [2021-11-11 09:58:28 +0000] [12] [ERROR] Exception in worker process superset_app | Traceback (most recent call last): superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker superset_app | worker.init_process() superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/gthread.py", line 92, in init_process superset_app | super().init_process() superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process superset_app | self.load_wsgi() superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi superset_app | self.wsgi = self.app.wsgi() superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi superset_app | self.callable = self.load() superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load superset_app | return self.load_wsgiapp() superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp superset_app | return util.import_app(self.app_uri) superset_app | File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 411, in import_app superset_app | app = app(*args, **kwargs) superset_app | File "/app/superset/app.py", line 44, in create_app superset_app | raise ex superset_app | File "/app/superset/app.py", line 34, in create_app superset_app | app.config.from_object(config_module) superset_app | File "/usr/local/lib/python3.8/site-packages/flask/config.py", line 174, in from_object superset_app | obj = import_string(obj) superset_app | File "/usr/local/lib/python3.8/site-packages/werkzeug/utils.py", line 568, in import_string superset_app | __import__(import_name) superset_app | File "/app/superset/config.py", line 1303, in <module> superset_app | import superset_config # pylint: disable=import-error superset_app | File "/app/docker/pythonpath_dev/superset_config.py", line 116, in <module> superset_app | AUTH_TYPE = AUTH_OAUTH superset_app | NameError: name 'AUTH_OAUTH' is not defined superset_app | [2021-11-11 09:58:28 +0000] [12] [INFO] Worker exiting (pid: 12) superset_app | [2021-11-11 09:58:28 +0000] [10] [INFO] Shutting down: Master superset_app | [2021-11-11 09:58:28 +0000] [10] [INFO] Reason: Worker failed to boot.` ### Expected results what you expected to happen. ### Actual results what actually happens. #### Screenshots If applicable, add screenshots to help explain your problem. ### Environment Environment latest, according latest docker-compose images. ### Checklist Make sure to follow these steps before submitting your issue - thank you! - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any. - [x] I have reproduced the issue with at least the latest released version of superset. - [x] I have checked the issue tracker for the same issue and I haven't found one similar. ### Additional context Add any other context about the problem here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
