LDAP plugin - #294
LDAP plugin#294DanielAuerX wants to merge 7 commits into
Conversation
|
@DanielAuerX Thank you very much for your contribution. A related issue has been mentioned before. #19 #61 |
eb5453c to
9812413
Compare
|
Hi @LinkinStars, currently i see two issues:
|
9812413 to
0e36f1a
Compare
|
Hi @LinkinStars, are you still interested in this plugin? If yes, I would continue working on it and finish the PR. |
|
A manual to test the plugin locally: |
here the related PR in answer core for 2. |
Problem described in 1) is addressed in 8c931fdd8a031c88b9b5207d6f7914e308cdb354 This is how the login page would look with branding/favicon and a green primary color: |
|
Hi @DanielAuerX, yes — we are still interested in supporting an LDAP connector. Thank you for picking this up again. The POST callback change in apache/answer#1612 is the right direction: credentials must not be sent in a GET URL. The custom login page is also acceptable for now; please do not spend more time polishing its visual design yet. Before we can merge, the two PRs need to complete the existing connector state flow:
Could you also rebase onto the current For the LDAP connector itself, please add tests for LDAP, LDAPS, StartTLS, private CA, failed authentication, and account binding. We also need a stable, configurable LDAP attribute for Once those pieces are updated, we will be happy to review the implementation in detail. Thanks again for the contribution. |
+ removed logs + using login.html + implemented ldaps: user can set a cert file for private ca
+ set tls.Config.ServerName in dialWithTLS so StartTLS connections (non-ldaps:// servers) actually verify. Without it every StartTLS attempt failed with "ServerName or InsecureSkipVerify must be specified". + fix extractUserInfo returning nil for the non-pointer plugin.ExternalLoginUserInfo struct, which failed to compile. + added missing go.sum and go-ldap/pacman + added readme
+ replace the bare unstyled form with a centered card layout matching common auth-page conventions + fetch /answer/api/v1/siteinfo client-side to set the page title, favicon, logo, and accent color from the site's configured branding/theme, falling back to plain defaults if the request fails. + keep the RECEIVER_URL_PLACEHOLDER form action and username/password field names unchanged so ConnectorSender/ConnectorReceiver still work.
+ ConnectorSender now reads state via ctx.Request.URL.Query() instead of ctx.Query(), which returns a stale cached value here since core injects state into the raw query after already having called ctx.Query() once. appends it to the receiver url so it survives the login forms post. + implemented ConnectorRequireState() to opt into cores strict state validation (cf pr apache/answer#1612). missing or invalid state is now rejected instead of treated as a normal login. + ExternalID now comes from a configurable, stable attribute (default entryUUID; objectGUID supported for Active Directory, including proper binary/mixed-endian decoding) instead of the mutable uid or sAMAccountName. + added tests (mocked dependencies) + dialWithTLS now returns the ldap.Client interface instead of the concrete *ldap.Conn enabling a mock ldap client in tests
2bb988c to
476ceaa
Compare



Hi, just wanted to check if there is interest in a ldap plugin such as this.
Obviously, some things that are specific to my use case have to be changed before merged, such as the login html and the email dummy solution.
included in this pr:
some ideas for future improvement: