I'm trying to integrate Airflow Webserver authentication with the Flask-AppBuilder RBAC available in Airflow 1.10.0, but no matter the configuration settings I try, I get an AttributeError: 'AnonymousUserMixin' object has no attribute 'roles'
.
Previously I had gotten the Airflow LDAP auth backend to work with my org's LDAP Microsoft AD server, but I can't get the configuration settings right to enable it to work with FAB RBAC. The Airflow and FAB documentations have very little to say about LDAP or troubleshooting it.
In the ${AIRFLOW_HOME}/webserver_config.py
file I have
# The authentication type
AUTH_TYPE = AUTH_LDAP
AUTH_ROLE_PUBLIC = "Public"
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Public"
AUTH_LDAP_SERVER = "ldaps://ldaps.myorg.org:636"
AUTH_LDAP_BIND_USER = "CN=myuser,OU=Service Accounts,DC=myorg,DC=org"
AUTH_LDAP_BIND_PASSWORD = "relevant_password"
AUTH_LDAP_SEARCH = "DC=myorg,DC=org"
AUTH_LDAP_UID_FIELD = "sAMAccountName"
# AUTH_LDAP_ALLOW_SELF_SIGNED = True
AUTH_LDAP_USE_TLS = False
AUTH_LDAP_APPEND_DOMAIN = "myorg.org"
AUTH_ROLE_ADMIN = "Admin"
And in {AIRFLOW_HOME}/airflow.cfg
I have
[webserver]
authenticate = True
rbac = True
I have already upgraded the backend Postgres DB so that it has the ab_
tables.
When I deploy everything via Docker Swarm and go to the appropriate Webserver URL, I just get the error listed above with the stack trace. It doesn't ever give me the option to log in (and I tried clearing the cookie), so I don't understand how to get it to let an 'anonymous' user even try to authenticate against the LDAP AD.
Is the issue
- the
webserver_config.py
LDAP settings? - the quotation marks around those settings?
- the
airflow.cfg
settings? - something about my org's LDAP server?
- something else?
Please let me know if I've left any information out. Thank you!