Page 1 of 1

Basic Auth on Apache 2.4 Forward Proxy

PostPosted: 25. June 2017 13:06
by Bilal
Website X is a public site that can be accessed only via Basic Authentication. Once I browse to it, I'll be prompted with a dialog box where I need to type in my username and password to authorize myself and access the website. With that said, I'm looking into setting up a forward proxy using Apache to do the Basic-Auth automatically, so I don't get prompted each time I access the site.

I've configured a forward proxy using Apache 2.4, and it seems to work fine as a forward proxy, as I could access HTTP and HTTPS websites through it. However, the Basic-Auth I'm trying to do on the X website, doesn't work. I still get the dialog box each time I navigate to the site.

In the "httpd.conf", I tried multiple configurations, one example is:
Code: Select all
AuthType Basic
AuthName "Restricted Site"
# (Following line optional)
AuthBasicProvider file
AuthUserFile password.file
Require valid-user

Mentioning that the password.file contains my username and password as a result of executing the command line:
Code: Select all
htpasswd -c password.file MyUser

The Apache starts successfully without throwing any errors.

IMHO, what I'm trying to do sounds technically possible. However, after several hours of trial and error, it doesn't seem as easy as I thought it would be. Suggestions?

Re: Basic Auth on Apache 2.4 Forward Proxy

PostPosted: 25. June 2017 20:43
by Nobbie
Bilal wrote:In the "httpd.conf", I tried multiple configurations, one example is:
Code: Select all
AuthType Basic
AuthName "Restricted Site"
# (Following line optional)
AuthBasicProvider file
AuthUserFile password.file
Require valid-user


Why? For what? Website X (which seems to be NOT your Website) is already doing a similar Basic Auth - what is the idea of doing a Basic Auth on your Xampp server as well?

Instead i cannot see any code which shows your Proxy configuration. How is it implemented? Please show your configuration.