-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Implement LDAP authentication for GL3 #5483
base: master
Are you sure you want to change the base?
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
50369f8
to
3a06655
Compare
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 1 New issue |
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
Contrary to what I expected and how GL2 handled this, GL3 stores the full DN in the
Greenlight LDAP configuration (unchanged from GL2 to GL3):
Is this expected behavior? Am I doing something wrong? Also: |
First of all, please understand that the developers of GL3 decided to not support multiple different external authentication methods anymore (and also either local OR external authentication). Instead they implemented only a single external method, namely OpenID Connect, with the suggestion to use Keycloak to support other protocols. Now, this PR adds unofficial support for LDAP without having a Keycloak in between the LDAP server and Greenlight. However, it does so using a different Ruby gem (omniauth-ldap) than what was used in Greenlight 2. This alone might lead to slightly different behavior. Also, maybe not all the environment variables from GL2 are supported here, best is to have a look at config/initializers/omniauth.rb to see what variable does what. Regarding the database entries with full DN, I also can't tell anymore how it looked in our GL2 database. But in our current GL3 database, all users have the full DN as external_id regardless of whether they have logged in after the migration or not. So I'm pretty sure it was the same before in our case and also would assume that I would have noticed the difference when migrating. Unfortunately, my knowledge about the LDAP protocol or how omniauth-ldap implements it is extremely limited, so I can't really give you advice how to achieve a different outcome. EDIT: Also, can you please check how the table looks before having User1 logged in after migration and also double-check that it isn't actually the same in the GL2 DB? If I'm not completely confused right now, it should create an entirely new user if the external_id didn't match on login. |
Ah, thank you for clarifying this.
Yes, the different ruby gem might explain everything. Frankly, I don't really care how the
Already did that: Before first LDAP-login in GL3 the "User1" row looks exactly the same as the "User2" row, which in turn is the same as in GL2 (except for |
Quality Gate passedIssues Measures |
This PR enables LDAP authentication for GL3 based on a forked omniauth-ldap (because it is currently unmaintained).
It was not developed with the goal to be merged upstream, but I'd like to provide our development to the public for anyone in need of this.
This PR is part of a series of similar PR submissions (Redis Sentinel, SAML integration, LDAP integration).
Details / How to use: