Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring the plugin on a new install results in failure #2

Open
AlexisLessard opened this issue Jun 21, 2019 · 1 comment
Open

Comments

@AlexisLessard
Copy link

I've tried using the plugin in a virtualenv on my RHEL 7 server, but an exception appears, even on a fresh install. We are using ActiveDirectory as our authentication backend.

Packages:
In my virtualenv, I've got theses installed:

  • "apache-airflow[celery]==1.10.3"
  • "apache-airflow[crypto]==1.10.3"
  • "apache-airflow[kubernetes]==1.10.3"
  • "apache-airflow[ldap]==1.10.3"
  • "apache-airflow[postgres]==1.10.3"
  • "apache-airflow[s3]==1.10.3"
  • "ldap3"
  • "airflow-alt-ldap"

Configuration
Here's the relevant configuration information:

[webserver]
authenticate = true
auth_backend = airflow-alt-ldap.auth.backend.ldap_auth

[ldap]
uri = ldaps://<ldap server>:636
user_filter = objectClass=*
user_name_attr = sAMAccountName
group_member_attr = memberOf
superuser_filter =
data_profiler_filter =
bind_user = CN=<bind user path>
bind_password = SECRET
basedn = <base dn>
cacert = /etc/ca/ldap_ca.crt <This file is absent>
search_scope = SUBTREE

For basedn, bind_user and bind_password, I'm using the same configuration we are using on other services using ldap as their authentication engine.

Result
Here's what I'm getting by just accessing the home page of the server after the install:

Traceback (most recent call last):
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask/app.py", line 2311, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask/app.py", line 1834, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask/app.py", line 1737, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask/_compat.py", line 36, in reraise
    raise value
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask/app.py", line 1832, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask/app.py", line 1818, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask_admin/base.py", line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/flask_admin/base.py", line 368, in _run_view
    return fn(self, *args, **kwargs)
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/airflow/www/views.py", line 731, in login
    return airflow.login.login(self, request)
  File "/home/airflow/virtualenv/lib/python3.6/site-packages/airflow-alt-ldap/auth/backend/ldap_auth.py", line 241, in login
    if current_user.is_authenticated():
TypeError: 'bool' object is not callable

Version information

  • Python 3.6.8
  • Virtualenv 16.6.1
  • RHEL 7.6

I'm not sure we'll be using this backend, but I tough it was important to raise a flag about this.

@oboki
Copy link

oboki commented May 26, 2020

in the file "/home/airflow/virtualenv/lib/python3.6/site-packages/airflow-alt-ldap/auth/backend/ldap_auth.py"

Change line 241 if current_user.is_authenticated (): to:
if current_user.is_authenticated:

Remove parentheses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants