Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Inheriting IIS Windows Basic Authentication on webserver to underlying MS SQL Perl database connectionby eelkonio (Initiate) |
on Aug 02, 2018 at 08:30 UTC ( [id://1219684]=perlquestion: print w/replies, xml ) | Need Help?? |
eelkonio has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys,
Even though I've been working in Perl for about 20 years, I've stumbled upon a challenge I can't really get my head around yet. Let me outline the problem. I've written some web-based support tools in Perl that I can run on localhost (also via a HTTP::Server::Simple webserver I wrote). However, each employee has different authorisations on the database servers: some can access databases A and B, others A, B and C, etc. Now we want the IIS server that will be used for these tools to use Windows Basic Authentication, so people will automatically be recognized and the permissions for the web server will be set accordingly. But each database requests that is generated by the Perl scripts, should inherit this authentication and send off requests to the MS SQL server using the user's authentication. How can I get the authentication values into my Perl script from IIS and use these to fire off requests to the MS SQL database with those same authentication values? Can I perhaps access the user's data via LDAP somehow? Btw: the MS SQL database connection also uses Windows Basic Authentication; the connect string I use personally for my scripts is: I expect I will be able to access the username via HTTP environment variables, but not the password. Those two are probably necessary to access the database with the user's credentials. So I'm stuck unless I start gathering passwords from users. Which of course is a security no-no. And asking a user to type in his password in a password field for each click isn't the way to go IMHO. Is there a way to inherit the windows authentication in Perl to access the database with the user's credentials that he used to access the IIS server? Hope you can help!
Back to
Seekers of Perl Wisdom
|
|