[
https://issues.apache.org/jira/browse/AIRFLOW-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802206#comment-15802206
]
Chris Riccomini commented on AIRFLOW-702:
-----------------------------------------
Full stack trace was:
{noformat}
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1641, in
full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1544, in
handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1639, in
full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib64/python2.7/site-packages/flask/app.py", line 1625, in
dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib64/python2.7/site-packages/flask_admin/base.py", line 69, in
inner
return self._run_view(f, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/flask_admin/base.py", line 368, in
_run_view
return fn(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/airflow/www/views.py", line 657, in
login
return airflow.login.login(self, request)
File
"/usr/lib/python2.7/site-packages/airflow/contrib/auth/backends/ldap_auth.py",
line 276, in login
flask_login.login_user(LdapUser(user))
File "<string>", line 4, in __init__
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/state.py", line 306,
in _initialize_instance
manager.dispatch.init_failure(self, args, kwargs)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/langhelpers.py",
line 60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/state.py", line 303,
in _initialize_instance
return manager.original_init(*mixed[1:], **kwargs)
File
"/usr/lib/python2.7/site-packages/airflow/contrib/auth/backends/ldap_auth.py",
line 148, in __init__
user.username)
File
"/usr/lib/python2.7/site-packages/airflow/contrib/auth/backends/ldap_auth.py",
line 106, in groups_user
groups_list = [regex.search(i).group(1) for i in user_groups]
AttributeError: 'NoneType' object has no attribute 'group'
{noformat}
> LDAP Auth Case Sensitive Regex
> ------------------------------
>
> Key: AIRFLOW-702
> URL: https://issues.apache.org/jira/browse/AIRFLOW-702
> Project: Apache Airflow
> Issue Type: Bug
> Components: security, webserver
> Environment: Connecting to Windows Active Directory
> Reporter: Robin Miller
> Assignee: Robin Miller
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> In the groups_user function in ldap_auth.py the regex is set to the following:
> regex = re.compile("cn=([^,]*).*")
> This is used to grab any groups by searching for sections of the form:
> "cn=LDAP_Group"
> However, Windows Active Directory returns groups in the form:
> "CN=LDAP_Group"
> This isn't caught by this regex, so throws an error when it tries to find it.
> An easy fix would be to make this regex case insensitive. I do not believe
> slackening this up will cause any issues.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)