Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKristina Petravičiūtė
11,270 PointsGet windows username using php
Hello,
I am trying to create intranet for my company as the new web developer. The intranet will be PHP - MSSQL driven. Does anyone know how I can get the username they used to log on to windows (Network) in my PHP scripts on the intranet.?
Thank you!
Kristina Petravičiūtė
11,270 PointsYes, I have windows network. So how can I use SSO with Active directory? I need to recognize user name and password in webpage based on php from windows log in information and automatically sing in into webpage. I don't know if you understand what I mean, but it's difficult for me to explain in English :)
1 Answer
Paul Bentham
24,090 PointsTry having a look at some of the answers on here:
http://stackoverflow.com/questions/168610/can-you-get-a-windows-ad-username-in-php
Gergő Bogdán
6,664 PointsGergő Bogdán
6,664 PointsSince PHP is interpreted and executed in some container, like Apache or NGinx on a server the way it should work is to authenticate users when these are trying to access the webpage implemented in PHP. For this you can use Single Sign On with Active directory if you have a windows network. If you could explain more details about what do you want to achieve we could give more concrete guidelines.