| 
 
 
 | 
| Keep Server Online 
 If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
 
 or
 
 
   
 A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
 
 Thank You! Steffen
 
 Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
 |  | 
 | 
| | 
| | 
|  Topic: require ldap-group not working in .htaccess |  |  
| Author |  |  
| terencewklau 
 
 
 Joined: 06 Aug 2015
 Posts: 2
 
 
 | 
|  Posted: Thu 06 Aug '15 8:34    Post subject: require ldap-group not working in .htaccess |   |  
| 
 |  
| Hi, 
 I've installed Apache 2.4.7 on Ubuntu Server 14.04.3 for the purpose of running OpenDCIM.
 
 The .htaccess file has the following config:
 
 AuthName "AD Authentication"
 AuthType Basic
 AuthBasicProvider file ldap
 AuthUserFile /var/www/.htpasswd
 AuthLDAPURL "ldap://domain.com/OU=Company Name,DC=domain,DC=com?sAMAccountName?sub?(objectClass=*)"
 AuthLDAPBindDN "CN=OpenDCIM LDAP Bind Service Account (P),OU=OpenDCIM,OU=Robot Users,OU=Users,OU=Company Name,DC=domain,DC=com"
 AuthLDAPBindPassword somepassword
 Require user dcim
 Require ldap-group CN=OpenDCIM Administrators,OU=OpenDCIM,OU=Global Application Security Groups,OU=Security Groups,OU=Company Name,DC=domain,DC=com
 
 The login dialog box appears when navigating to the site and the local dcim user account works.  But AD users in the security group "OpenDCIM Administrators" are not working.
 
 Error log says "User user.name not found".  I've tried the following username format:
 
 user.name
 domain\user.name
 user.name@domain.com
 
 And none of them work.  If I  modify the .htaccess file to:
 
 AuthName "AD Authentication"
 AuthType Basic
 AuthBasicProvider file ldap
 AuthUserFile /var/www/.htpasswd
 AuthLDAPURL "ldap://domain.com/OU=Company Name,DC=domain,DC=com?sAMAccountName?sub?(objectClass=*)"
 AuthLDAPBindDN "CN=OpenDCIM LDAP Bind Service Account (P),OU=OpenDCIM,OU=Robot Users,OU=Users,OU=Company Name,DC=domain,DC=com"
 AuthLDAPBindPassword somepassword
 Require valid-user
 
 Then it works but for all AD users, which is not ideal.
 
 Any advice would be much appreciated.
 |  |  
| Back to top |  |  
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Fri 07 Aug '15 11:05    Post subject: |   |  
| 
 |  
| Since Require valid-user works, you may try 
 Require group group-name group2-name
 |  |  
| Back to top |  |  
| terencewklau 
 
 
 Joined: 06 Aug 2015
 Posts: 2
 
 
 | 
|  Posted: Fri 07 Aug '15 15:00    Post subject: |   |  
| 
 |  
| Nested groups was the issue. Had to add: 
 AuthLDAPMaxSubGroupDepth 1
 AuthLDAPSubgroupAttribute member
 AuthLDAPSubGroupClass group
 AuthLDAPGroupAttribute member
 |  |  
| Back to top |  |  
 
 | 
 |  | 
 |  |