1
votes

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:

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:

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?

1

1 Answers

1
votes

[You] --a--> [Forward Proxy] --b--> [Server]

If you in connection b have to use Basic auth and don't want to use it in connection a. you can use RequestHeader set Authorization "Basic ..." to add the Authorization header to all requests.