You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/02/01 08:10:04 UTC
[GitHub] [superset] shikhnu opened a new issue #12855: Configuring OAuth
shikhnu opened a new issue #12855:
URL: https://github.com/apache/superset/issues/12855
Hi,
While configuring oAuth, I am encountering some issues. I am using superset with the help of docker.
System: Linux (ubuntu 18.04)
File location: /home/myuserx/incubator-superset/docker/pythonpath_dev/superset_config.py
Below is the code used in superset_config.py
```
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# This file is included in the final Docker image and SHOULD be overridden when
# deploying the image to prod. Settings configured here are intended for use in local
# development environments. Also note that superset_config_docker.py is imported
# as a final step as a means to override "defaults" configured here
#
import logging
import os
from flask_appbuilder.security.manager import (
AUTH_OID,
AUTH_REMOTE_USER,
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH
)
#from flask_appbuilder.security.manager import AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH
basedir = os.path.abspath(os.path.dirname(__file__))
ROW_LIMIT = 5000
SUPERSET_WORKERS = 4
SECRET_KEY = 'a long and random secret key'
SQLALCHEMY_DATABASE_URI ='postgresql://superset:superset@db:5432/superset'
CSRF_ENABLED = True
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Public"
OAUTH_PROVIDERS = [
{
'name':'google', 'icon':'fa-google', 'token_key':'access_token',
'remote_app': {
'client_id':'GOOGLE KEY',
'client_secret':'GOOGLE SECRET',
'api_base_url':'https://www.googleapis.com/oauth2/v2/',
'client_kwargs':{
'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'}
}
]
```
Below is the error that I am encountering.
```
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 184, in find_app_by_string
app = call_factory(script_info, attr, args)
File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 119, in call_factory
return app_factory()
File "/app/superset/app.py", line 69, in create_app
raise ex
File "/app/superset/app.py", line 62, in create_app
app_initializer.init_app()
File "/app/superset/app.py", line 551, in init_app
self.init_app_in_ctx()
File "/app/superset/app.py", line 520, in init_app_in_ctx
self.configure_fab()
File "/app/superset/app.py", line 591, in configure_fab
appbuilder.init_app(self.flask_app, db.session)
File "/usr/local/lib/python3.7/site-packages/flask_appbuilder/base.py", line 202, in init_app
self.sm = self.security_manager_class(self)
File "/usr/local/lib/python3.7/site-packages/flask_appbuilder/security/sqla/manager.py", line 51, in __init__
super(SecurityManager, self).__init__(appbuilder)
File "/usr/local/lib/python3.7/site-packages/flask_appbuilder/security/manager.py", line 250, in __init__
from authlib.integrations.flask_client import OAuth
ModuleNotFoundError: No module named 'authlib'
```
I have also attached a screenshot of the error. I would appreciate it if anyone can help me out in resolving the issue.
Regards.
![Error_SS](https://user-images.githubusercontent.com/56694179/106431157-d8309f00-6492-11eb-83fd-80b540f0e33f.png)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] applike-ss commented on issue #12855: Facing problem while configuring OAuth
Posted by GitBox <gi...@apache.org>.
applike-ss commented on issue #12855:
URL: https://github.com/apache/superset/issues/12855#issuecomment-974083065
Is there any reason not to include it in the docker image?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] shawnzhu commented on issue #12855: Facing problem while configuring OAuth
Posted by GitBox <gi...@apache.org>.
shawnzhu commented on issue #12855:
URL: https://github.com/apache/superset/issues/12855#issuecomment-855522807
@dpgaspar is right, I created #15010 to document the required package `authlib`. and the aboe error message will be gone after the installation of `authlib`.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] dpgaspar edited a comment on issue #12855: Facing problem while configuring OAuth
Posted by GitBox <gi...@apache.org>.
dpgaspar edited a comment on issue #12855:
URL: https://github.com/apache/superset/issues/12855#issuecomment-770743282
Authentication is supported by FAB and to use OAuth you have to install authlib here's the documentation: https://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-oauth
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] dpgaspar commented on issue #12855: Facing problem while configuring OAuth
Posted by GitBox <gi...@apache.org>.
dpgaspar commented on issue #12855:
URL: https://github.com/apache/superset/issues/12855#issuecomment-770743282
Authentication is supported by FAB and to use OAuth you have to install authlib: https://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-oauth
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] singhswg commented on issue #12855: Facing problem while configuring OAuth
Posted by GitBox <gi...@apache.org>.
singhswg commented on issue #12855:
URL: https://github.com/apache/superset/issues/12855#issuecomment-1022545681
Guys can we support this in the dockerfile/requirements provided in the repo itself so folks dont have to create their own custom images? Clearly it's an easy fix and multiple people have been facing it.
Example - https://stackoverflow.com/questions/66658696/superset-oauth-no-module-named-authlib
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org