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

Fix integration with Apache httpd mod_auth_ldap #37

Open
SleeplessAnnoyedNerd opened this issue Oct 12, 2017 · 1 comment
Open

Fix integration with Apache httpd mod_auth_ldap #37

SleeplessAnnoyedNerd opened this issue Oct 12, 2017 · 1 comment

Comments

@SleeplessAnnoyedNerd
Copy link

SleeplessAnnoyedNerd commented Oct 12, 2017

Hi,

just dumping this here maybe it helps someone. (And yes, I know, there exists a "direct" integration of PrivacyIDEA and Apache HTTPD 2.2. But there are always people who wants to do it differently. ;) )

Let's assume you use mod_auth_ldap for Apache HTTPD and want to use ldap proxy before your real LDAP server. So your configuration may look like the following snippet...

AuthType Basic
AuthName "Xxx Web Services"

AuthBasicProvider ldap
AuthLdapURL ldap://your-ldap-proxy|server/o=YourCompany,dc=YourCompany,dc=com?uid
AuthzLDAPAuthoritative on
AuthLDAPGroupAttributeIsDN off
AuthLDAPGroupAttribute memberUid

Current implementation of ldap proxy fails b/c of two reasons:

  1. Referenced ldaptor (https://github.com/twisted/ldaptor/, 16.0.1) doesn't implement LDAPCompareRequest.
  2. ldap proxy crashes and burns b/c it doesn't handle LDAPCompareRequest properly also.

My fix was to checkout current (34367e3ad5404b8f46def4a40d9eea4c375fa300) version of ldaptor and use that one. And also to modify proxy.py of ldap proxy a bit (line 283):

        elif isinstance(request, pureldap.LDAPCompareRequest):
            log.info('Incoming LDAPCompareRequest.')
            # log.info(request)
            return request, controls

(LDAPCompareRequest is used for checking of group membership.)

According to my quick and dirty tests it works. And I'm happy...

@fredreichbier
Copy link
Contributor

Thanks a lot for sharing your experience! This is indeed very useful information :)
I'll keep this issue open so we can see what we can do about the LDAP compare requests.

@fredreichbier fredreichbier changed the title If you use ldap proxy for Apache HTTPD Fix integration with Apache httpd mod_auth_ldap Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants