1

So im using Apache 2.4, I want to set up a basic auth connected with LDAP and then, reverse proxy. The idea is to secure a webpage with this authorization. So here is my config:

   Order deny,allow
   Deny from All
   AuthType Basic
   AuthName "Please login"
   AuthBasicProvider ldap
   #LDAPVerifyServerCert Off
   AuthLDAPURL ldap://ldap data here
   AuthLDAPBindDN "dn here"
   AuthLDAPBindPassword pass
   AuthLDAPGroupAttribute sAMAccountName
   AuthLDAPGroupAttributeIsDN off
   #Require ldap-group some settings
   Require ldap-filter ldapsettingshere
   AuthLDAPMaxSubGroupDepth 1
   #Require valid-user
   #Satisfy any
   RequestHeader unset Authorization


   ProxyRequests On
ProxyVia On

ProxyPass / http://numbers:8090/
ProxyPassReverse / http://numbers:8090/
ProxyPreserveHost On
#RequestHeader set Authorization "Basic"
#ProxyRequests           Off
#AllowEncodedSlashes     NoDecode
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

The problem is that when I access my Apache http it doesn't prompt for the basic auth password and login, it just goes straight to the proxied webpage. Any idea what am I doin wrong?

UPDATE: OK, I have uncommented:

RequestHeader set Authorization "Basic"

But now Im in infinite loop of basic auth prompts, which are coming from the end server so its not the case.

Chrzciciel
  • 53
  • 1
  • 8

1 Answers1

3

The cause of this was that I have put the whole Auth part inside <Directory "/var/www/html"></Directory>, I have changed it to <Location "/"></Location> and it works like a charm!

Chrzciciel
  • 53
  • 1
  • 8