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

Issues with LDAP Auth (how to set search base, etc) #43

Closed
ben-github opened this issue Oct 23, 2014 · 5 comments
Closed

Issues with LDAP Auth (how to set search base, etc) #43

ben-github opened this issue Oct 23, 2014 · 5 comments

Comments

@ben-github
Copy link
Contributor

I see that Flask-AppBuilder supports ldap but the only documentation I can find for it is at http://flask-appbuilder.readthedocs.org/en/latest/config.html?highlight=ldap which only lists one configuration parameter, AUTH_LDAP_SERVER:

define your ldap server when AUTH_TYPE=2
example:

AUTH_TYPE = 2
AUTH_LDAP_SERVER = “ldap://ldapserver.new“

How do you configure the ldap search base and filter, bind address, etc?

Also, the documentation shows setting the ldap server field with double quotes. I seems this is necessary as using single quotes gives me error. This is confusing as other parameters (AUTH_ROLE_ADMIN for example) are set using single quotes.

I've tried both

AUTH_TYPE = 2
AUTH_LDAP_SERVER = “ldap://localhost“

and

AUTH_TYPE = 2
AUTH_LDAP_SERVER = “ldap://ou=people,dc=example,localhost“

and in both cases, login fails but I a port sniff shows no connection to my ldap server (running on port 389 on 127.0.0.1 / localhost. Any suggestions on how to track down why it isn't connecting to the ldap server? No errors in the python terminal running Flask-AppBuilder. Are there any other settings and/or maybe python modules I need?

Thanks,

@ben-github
Copy link
Contributor Author

Ok, I discovered that is won't try to do ldap auth if the user hasn't already been created. So I needed to switch to database auth, add my ldap users and then switch back to ldap auth (this should be documented / or better yet it would be nice new users could auto-populate). Once I did this, I can see ldap auth attempts, but only when using the

AUTH_LDAP_SERVER = “ldap://localhost“

line and not

AUTH_LDAP_SERVER = “ldap://ou=people,dc=example,localhost“

So I think my only issue now is setting the search base for ldap.

@ben-github
Copy link
Contributor Author

Looking at the code more, I see that it doesn't support indirect LDAP binds. I've got a patch that adds that functionality. Take a look at
ben-github@9703ef9

It doesn't change default behavior, but if you add a new LDAP_AUTH_SEARCH parameter, it uses that to search for the right bind address. New options are documented with config.rst

@dpgaspar
Copy link
Owner

Great! please submit a pull request.

@ben-github
Copy link
Contributor Author

Done in #44.

@dpgaspar
Copy link
Owner

dpgaspar commented Nov 4, 2014

New 1.0.1 is out. Your pull requests are included on it.

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

No branches or pull requests

2 participants