Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NTLM Login using PHP and Apache

I would like to login into my system using ntlm protocol. I found module for apache - mod_auth_sspi, but i need multi platform solution.

My application have to run on windows and linux (on both is installed php>=5.3 and apache>2.0). Using mod_auth_sspi i am able to login via ntlm, but only if I set a:

required user-valid

in htaccess or http.conf. If I don't set this value I can't retrieve USER_REMOTE and I don't know how can I implement solution that I need:

I'm looking for solution that allow me show to user form with login/password (ntlm) or if user cancelled this form the system should redirect him to alternative login form (data will retrieve from database). I need to login into the system in 2 ways: via NTLM and traditional (database). How Can I do this?

Thx.

like image 587
user1119698 Avatar asked Jul 19 '26 12:07

user1119698


1 Answers

You could use mod_auth_sspi for windows, and http://modntlm.sourceforge.net/ for linux. I know it isn't the best solution, but it should work (i guess you will have to check what OS the script is running on and choose the mod appropriately since I doubt the APIs are the same).

EDIT:

For multiple login providers, see this:

http://httpd.apache.org/docs/2.3/howto/auth.html#multprovider

like image 160
Sam Bloomberg Avatar answered Jul 21 '26 04:07

Sam Bloomberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!