Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows authentication with PHP on IIS

I'm Working on an Intranet application that is build in PHP on IIS. I want to authenticate against an AD by passing the username automatically from the browser to the IIS using windows authentication. Is there anyway to do that?

like image 486
Shirko Shwan Avatar asked Jan 18 '26 02:01

Shirko Shwan


1 Answers

Yes, IIS supports integrated Windows authentication. Access the 'Authentication' option for your website...

IIS1

...and change the 'Windows Authentication' item to 'enabled' (and perhaps 'Anonymous Authentication' to 'disabled' if you want to force users to authenticate)...

IIS2

More details are available on Technet.

In PHP the username should be populated in the $_SERVER superglobal. I think as AUTH_USER, but I can't confirm that right now. Use var_dump($_SERVER); to find the correct key.

like image 141
timclutton Avatar answered Jan 19 '26 17:01

timclutton



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!