Basic Authentication in Apache 2.4.18 (ubuntu) using LDAP

Asked 2 years ago, Updated 2 years ago, 127 views

I would like to perform Basic authentication using LDAP on Apache 2.4.18, but I received the following description file from my colleague.

username:test.dev
password:test
trees:LDAP-DEV
Hostname: dev.auth-ldap.co.jp
port number: 636 (or 389)

Followed by this file to modify Apache2 configuration file (/etc/apache2/sites-available/000-default.conf):

...
<Directory/usr/lib/cgi-bin>
AuthType Basic
AuthName "ID/Password"
AuthType Basic
AuthBasicProvider ldap
AuthLDAPURL ldap://dev.auth-ldap.co.jp:389
AuthLDAPBindDN "test.dev"
AuthLDAPBindPassword "test"
require valid-user
...
</Directory>
...

However, LDAP doesn't work at all, and the cgi-bin / bottom that can be connected is no longer connected.

apache ubuntu ldap

2022-09-30 18:37

1 Answers

You need information about the attributes that contain the BaseDN and username.
I think LDAP-DEV in Tree is part of BaseDN, so please check it out.

The AuthLDAPURL directive has the following format:(Reference: Manual)

AuthLDAPURL ldap://host:port/basedn?attribute?scope?filter

For example, if the BaseDN is "dc=LDAP-DEV,dc=local" and the username attribute is "uid", set it as follows:

AuthLDAPURLldap://dev.auth-ldap.co.jp:389/dc=LDAP-DEV,dc=local?uid

If you want to filter with objectClass or other attributes, set it as follows:

AuthLDAPURLldap://dev.auth-ldap.co.jp:389/dc=LDAP-DEV,dc=local?uid?sub?(objectClass=inetOrgPerson)


2022-09-30 18:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.