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 2022/02/23 10:45:32 UTC
[GitHub] [superset] zeromsi opened a new issue #18867: Failed to used LDAP with superset in Docker
zeromsi opened a new issue #18867:
URL: https://github.com/apache/superset/issues/18867
I'm trying to use my local LDAP server as authentication server of superset in a containerized environment.
My Dockerfile:
```Dockerfile
FROM apache/superset
USER root
RUN apt-get update -y && apt-get install -y python3-dev libldap2-dev libsasl2-dev ldap-utils tox lcov valgrind
RUN pip install python-ldap
COPY superset_config.py .
RUN mv ./superset_config.py /app/superset/
USER superset
```
superset_config.py:
```python
import os
#ADDED
from flask_appbuilder.security.manager import AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH
# Superset specific config
#---------------------------------------------------------
ROW_LIMIT = 5000
SUPERSET_WORKERS = 4
SUPERSET_WEBSERVER_PORT = 8088
#SUPERSET_WEBSERVER_TIMEOUT = 60
## Flask-WTF flag for CSRF
WTF_CSRF_ENABLED = False
# Set this API key to enable Mapbox visualization
#MAPBOX_API_KEY = ‘Miakey’
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
# Cache config
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_HOST': 'redissuperset',
'CACHE_REDIS_PORT': 6379,
'CACHE_REDIS_DB': 1,
'CACHE_REDIS_URL': 'redis://redissuperset:6379/1'}
# Postgres DB config
SQLALCHEMY_DATABASE_URI = \
'postgresql+psycopg2://superset:superset@postgressuperset:5432/superset'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = 'wifbeiaufkdb29475jfdbskfrh493hdb'
# Proxy for Load Balancer
ENABLE_PROXY_FIX = True
# Debug option
DEBUG = False
LOG_LEVEL = 'DEBUG'
# ----------------------------------------------------
# AUTHENTICATION CONFIG
# ----------------------------------------------------
# The authentication type
# AUTH_OID : Is for OpenID
# AUTH_DB : Is for database (username/password()
# AUTH_LDAP : Is for LDAP
# AUTH_REMOTE_USER : Is for using REMOTE_USER from web server
#AUTH_TYPE = AUTH_DB
# Uncomment to setup Full admin role name
AUTH_ROLE_ADMIN = 'Admin'
# Uncomment to setup Public role name, no authentication needed
# AUTH_ROLE_PUBLIC = 'Public'
# Will allow user self registration
AUTH_USER_REGISTRATION = True
# The default user self registration role
# AUTH_USER_REGISTRATION_ROLE = "Public"
AUTH_USER_REGISTRATION_ROLE = "Admin"
#AUTH CONFIG LDAP AND DB AUTH cannot be used both at the same time
# When using Local DB AUTH uncomment following parameter and comment "AUTH_LDAP"
#AUTH_TYPE = AUTH_DB
# When using LDAP Auth, setup the ldap server
AUTH_TYPE = AUTH_LDAP
AUTH_LDAP_SERVER = "ldaps://192.168.68.135:636"
AUTH_LDAP_SEARCH = "cn=zeromsi,ou=groups,dc=example,dc=com"
AUTH_LDAP_UID_FIELD = "uid"
# AUTH_LDAP_FIRSTNAME_FIELD = "givenName"
# AUTH_LDAP_LASTNAME_FIELD = "sn"
# AUTH_LDAP_EMAIL_FIELD = "mail"
AUTH_LDAP_BIND_USER = "uid=zeromsi,ou=people,dc=example,dc=com"
AUTH_LDAP_BIND_PASSWORD = "admin"
AUTH_LDAP_ALLOW_SELF_SIGNED = True
# ---------------------------------------------------
# Roles config
# ---------------------------------------------------
# Grant public role the same set of permissions as for the GAMMA role.
# This is useful if one wants to enable anonymous users to view
# dashboards. Explicit grant on specific datasets is still required.
#PUBLIC_ROLE_LIKE_GAMMA = False
# ---------------------------------------------------
# Babel config for translations
# ---------------------------------------------------
# Setup default language
BABEL_DEFAULT_LOCALE = 'en'
# Your application default translation path
BABEL_DEFAULT_FOLDER = 'babel/translations'
# The allowed translation for you app
LANGUAGES = {
'en': {'flag': 'us', 'name': 'English'},
'it': {'flag': 'it', 'name': 'Italian'},
# 'fr': {'flag': 'fr', 'name': 'French'},
# 'zh': {'flag': 'cn', 'name': 'Chinese'},
}
```
--
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] villebro commented on issue #18867: Failed to used LDAP with superset in Docker
Posted by GitBox <gi...@apache.org>.
villebro commented on issue #18867:
URL: https://github.com/apache/superset/issues/18867#issuecomment-1048702893
You need to add some more context, like logs, error messages etc, otherwise it will be very difficult for others to help. In addition, this appears to be a question on how to enable LDAP - @zeromsi have to checked if the proposed solution in the FAB docs works? https://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-ldap
--
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