-
Notifications
You must be signed in to change notification settings - Fork 44
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
LDAP + Traefik #14
Comments
Sure! Let's get you going! I'm not sure how far you've gotten so far but fir you need to get the server running. Presumable in pure docker so have a look here: https://github.com/travisghansen/external-auth-server#docker After it's running somewhere that will be accessible by traefik you need to generate an appropriate With Which subsequently uses config options from here: https://github.com/vesse/node-ldapauth-fork#ldapauth-config-options With the My testing with If you're stuck somewhere in the process and need more detailed info for a particular stage let me know. Thanks! |
The basic auth works successfully for a user via LDAP Active Directory ! Nice This is the config : plugins: [ Next step : if i want to only only a user from a AD group ? What can i do ? Play with header maybe ? I also wonder how to use the realm parameter ? |
I intend to allow assertions on the ldap userinfo, but you should be able to use the built-in functionality of the ldap lib too. Have a look here and let me know if you get it to work correctly: vesse/passport-ldapauth#10 |
I've already try to make a 'searchFilter' which handle the require group . Without success. Still, Valid user can connect every time . But it's maybe some cache somewhere ... |
Well, there are other params. Did you see the |
Also, yeah during testing set cache to 0. |
The |
Hum , another stupid thing , but all my AD group contains parenthesis in DN ..... So ii try to espace it thi /(XXXX/) or /28XXX/29 but in log every time it's not escape : memberOf: CN=XXX,OU=XXX (YYYY),OU=XXX,DC=XXX,DC=XXX,DC=XXX,DC=XXX |
Is it possible to try with a group that doesn't need escaping? I'll dig into the escaping behavior to see what's needed. My LDAP skills are limited so I appreciate the patience and help making it work :) |
Great Github only escape ... WTF ! Unfortunatly , i haven't found any group Without parenthesis in DN ....
What i expect to see in the log is either '\(XXXX\)' or '\28XXXX\29' , cause it is working with ldapsearch I think there is two thing happend there :
From the ldap module , i've seen a sanitize input fonction only for username (https://github.com/vesse/node-ldapauth-fork/blob/master/lib/ldapauth.js)
|
I've got my dev environment back up and testing out those parameters locally. Couple notes:
I'll test a group name with parens shortly.. |
Waoooo .... quick answer and debug ... thanks ! Can you please keep me updated ? |
Yeah, still digesting the behavior of the options but I'm close. Just so my test is sane is this an example of what a group looks like for you?
|
I just tried a filter like this and it worked as expected:
|
Be careful with spaces between the filters, I noticed if I had anything in there it was behaving badly.. |
almost : Something like that |
in my plugin configuration searchFilter : "(&(sAMAccountName=blabla)(memberOf=CN=GG-BLABLA,OU=BLABLA BLIBLI ,OU=Groupes (GG),OU=XXXX,DC=XXXX,DC=XXXX,DC=XXXX,DC=XXXX))" |
i've try also with another Attribute -> manager This one doesn't contains parenthesis but still space inside DN. It's not working |
Yeah, maybe it's the space, let me do some testing with that.. |
Space worked here too. You're probably getting bit by the bug I found. Let me get that fix committed real fast and get an updated docker image built.. |
Ok ! Thanks so much , will try soon and keep you informed ! |
When this build completes force the container(s) to update and try again: https://travis-ci.org/travisghansen/external-auth-server/builds/550907791 |
OK, it's built.. |
I've just try the new build . Same behavious . From the RFC LDAP , i've read that parenthesis inside DN need to be espace I've also try to set the filter with another attribute (my personal CN) and it is neither working. I wonder if the filter is used ..... This is my last try search filter : (work well in ldapsearch) |
Last try done . I'm pretty sure filter is not used at all . |
Hum , i've found something interesting ! If the ldap cache parameter is not set , the node-ldapauth push the default value to False https://github.com/vesse/node-ldapauth-fork You set it to true I need to do more test ^^ |
Do you have a way to make the node-ldapauth more versbose . I see the log parameter , but i've no idea how to use it |
Let me see if there's a way to enable more logging. Regarding cache, don't set the cache property from the library options block I'm certain the filters do work in my setup. I changed them to various options and they do take effect. |
I've integrated the ldap logging into the app, simply set the Let me know if it helps you find anything. |
image set to next , connection.log set to true . Nothing more with docker logs . This is the tokenized output from docker logs info: starting verify for plugin: ldap { info: end verify pipeline with status: 200 |
Something is off :( I get a whole slew of debug messages from the authenticate method. Are you running this in pure docker? If so would you be comfortable adding debug lines into the code after starting the image? or alternatively running from source? |
GOT IT ! After a clean reboot , some refactoring , and set the basic stuff . It works Thanks to your debug ! My Active directory account (service account ) is not working with your container Really don't knwo why ! (Maybe the slash in the password.....) But when i bind with my personnal account , it works ! I can also use member filtering ! GREAT Thanks you so much |
Nice! Can you share your final config minus secrets? I'll add it to a list of examples. Also, I'll debug bad bind creds..that should fail not be allowed through so I'll make sure to fix that up if I find anything. |
yeap, i'm wondering if the encoreURI component play well with single slash .... This is my configuration:
|
Mind sharing which direction the slash is? I'll test it out.. |
I'll review your config and send over some suggestions for prod usage later as well.. |
bindCredentials : 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\rxxxxxxxxxxx', don't ask me why this happend in my password .... |
Ok I'll have a look.. |
@jbperrin88 ok, here's my findings:
Specifically set the |
I just landed all the tweaks I've made to ldap into master including userinfo asserstions as an FYI. |
Hi there ,
Such a nice project , something i was looking for a long long time.
I'm trying to handle Basic auth in traefik reverse proxy and forward auth to LDAP AD via your services
Can you please , give me some tips . some help to configure all the stuff ?
I want to use it in a single docker env
dynamicly forward auth via label https://docs.traefik.io/v2.0/middlewares/forwardauth/
Try to allow or not by LDAP valid user , or group mapping .
Thanks you !
The text was updated successfully, but these errors were encountered: