Has anyone implemented OAuth with superset? I feel like I'm very close and need help with the last mile.
import os
from flask_appbuilder.security.manager import AUTH_OAUTH
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_HOST': 'redis',
'CACHE_REDIS_PORT': 6379,
'CACHE_REDIS_DB': 1,
'CACHE_REDIS_URL': 'redis://redis-service:6379/1'}
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://postgres-service:5432'
SECRET_KEY = 'thisISaSECRET_1234'
AUTH_TYPE = AUTH_OAUTH
CSRF_ENABLED = False
TESTING = True
WTF_CSRF_ENABLED = False
RECAPTCHA_USE_SSL = False
RECAPTCHA_PUBLIC_KEY = ''
RECAPTCHA_PRIVATE_KEY = ''
MAIL_USE_TLS = False
MAIL_PASSWORD = 'test'
USER_ENABLE_LOGIN_WITHOUT_CONFIRM_EMAIL = True
USER_ENABLE_CONFIRM_EMAIL = False
EMAIL_NOTIFICATIONS = False
DEBUG = True
# Will allow user self registration
AUTH_USER_REGISTRATION = True
# The default user self registration role
AUTH_USER_REGISTRATION_ROLE = 'Admin'
OAUTH_PROVIDERS = [
{'name':'github', 'icon':'fa-github', 'token_key':'access_token',
'remote_app': {
'consumer_key':'GIT CLIENT ID',
'consumer_secret':'GIT CLIENT SECRET',
'request_token_params':{'scope': 'user:email'},
'request_token_url':None,
}
]
Do i need to override the oauth_user_info_getter method? what would that look like in the superset_config.py file?
Thank you very much! Have really enjoined the tool.
PS: I'm using a slightly modified container as the 0.17.0 version I've just rebuilt it with the additional flask modules needed for oauth.