Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

How to intercept the HTTP Authorization popup with a fancy html page

$
0
0
Hello guys!

I have a question related to intercepting Authorization popup.

I have a site that uses basic User name / Password authentication. I have created a nice html page to accept the username & password + few other parameters from the user. Now I am ready to pass this on to the system.

- Server runs on Port: 80
- http://localhost -> takes the user to the fancy login page (username/password/few other parameters)
- User click the submit button the request gets posted to /validate/

location /validate/
{
set_form_input $username;
set_form_input $password;
set $auth_raw "$username:$password";
set_encode_base64 $digest $auth_raw; # $digest = some_hash_value

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Authorization "Basic <<<some_hash_value>>>"; # This works
#proxy_set_header Authorization "Basic $digest"; # This does not work
}

My question is how can I pass dynamic $digest value to the Autorization header.

Any help is much appericiated! Thanks.

LD

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>