我当前遇到的问题是 LDAP 设置似乎不适用于 Airflow。我当前的代码不会生成登录屏幕,docker 容器中也没有日志显示它正在尝试连接到 LDAP 服务器。我试图遵循这些教程,但它们似乎什么也没做(即webserver_config.py
没有被使用)教程一 https://itsecureadmin.com/2019/02/apache-airflow-1-10-2-active-directory-authentication-via-ldaps/ 教程二 https://guptakumartanuj.wordpress.com/2019/11/14/airflow-ui-authentication-through-ldap-server/
任何有关连接如何工作的信息将不胜感激!
webserver_config.py
:
import os
from airflow import configuration as conf
from flask_appbuilder.security.manager import AUTH_LDAP
basedir = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN')
CSRF_ENABLED = True
AUTH_TYPE = AUTH_LDAP
AUTH_ROLE_ADMIN = 'Admin'
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Admin"
#AUTH_USER_REGISTRATION_ROLE = "Viewer"
AUTH_LDAP_SERVER = 'ldapserveraddressherebutIwon'tshowyousorry'
AUTH_LDAP_SEARCH = "***"
AUTH_LDAP_BIND_USER = '***'
AUTH_LDAP_BIND_PASSWORD ="*******************"
AUTH_LDAP_UID_FIELD = 'sAMAccountName'
AUTH_LDAP_USE_TLS = False
AUTH_LDAP_ALLOW_SELF_SIGNED = False
# Get relative path for CA certificate file
script_dir = os.path.dirname(__file__)
AUTH_LDAP_TLS_CACERTFILE = script_dir + "ca.cer"
我已经删除了authenticate = True
and auth_backend = airflow.contrib.auth.backends.ldap_auth
from airflow.cfg
and my webserver_config.py
位于同一文件夹中以供使用。
这可以通过以下方式实现airflow.cfg
.
请阅读下面的 LDAP 部分并告诉我。
https://airflow.apache.org/docs/stable/security.html https://airflow.apache.org/docs/stable/security.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)