Jump to content

Recommended Posts

Posted

Hi,

 

our website uses the users Active Directory details to login to the school website using php and ldap.

 

Is it possible to get the users AD username that they used to login to the networked PC with and pass it as a variable to log them into the website.

 

Cheers,

 

Nick

Posted

It should be possible - depends on what language you are using ASP(.net) or PHP?

Never done it myself but it should be possible...

Posted

I've not used adLDAP with PHP so can't comment on it but it looks as if it should work :-)

 

Are you running PHP on IIS? If so, could you change the home page to be an ASP page; that can then use integrated authentication to find out who's there and then that ASP page can call the "real" home PHP page and pass the user to it.

 

You can also set something in every PHP page to say "is logon user set?; yes - carry on; no - redirect to ASP code to find it"

Posted

Thanks guys. I'll have a look adLDAP and see if I can figure it out. I'm using PHP on IIS. The home page is heavily reliant on PHP so unfortunately ASP isn't an option.

 

Could there be a way to do it with javascript??

Posted
Thanks guys. I'll have a look adLDAP and see if I can figure it out. I'm using PHP on IIS. The home page is heavily reliant on PHP so unfortunately ASP isn't an option.

 

Could there be a way to do it with javascript??

 

You can still keep your existing home page.

 

Let's say the home page is called "index.php" and that's picked up because you have IIS set to use that as default. You change IIS so that it uses default.asp as the default page. All that page does is get the ID and call index.php - users see nothing apart perhaps from a very quick URL change.

 

If users have a short cut to http:///index.php instead of http:// then just adding code to index.php to check if you have a username and, if not, doing a quick call to default.asp

 

The javascript idea is good but I don't think you can do it - you need to do something like reading environment variables or making shell calls and I think pretty much everything like that is blocked by the browser for security reasons.

Posted
Sounds like you're already doing integrated authentication, which means you can just use the environment variables IIS gives you from your PHP script. Off the top of my head I don't remember what they are ($_SERVER['AUTH_USER'] rings a bell)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...