Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    NT Authentication

    I'm not sure if this is the right forum for this....


    I will be writing an application using PHP and mysql. Just wondering how can I read a users NT username in PHP? I need to do this to determine which NT Groups they are in to determine access.

    Anyone done this before - any tips (I'm new to PHP.....)

    I have done something before in ASP to read in there NT username and used Permission Checker - is there anything like permission checker in PHP?

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I suppose you are talking about Windows Authentication.
    I don't think it is possible, because you need the LOGON_USER - servervariable, which i nowhere see included in the PHP documentation.
    As far as i see ( http://be2.php.net/features.http-auth ), HTTP authentication is onl supported for Apache

    There is an easy way to find out. Run this in a PHP file
    PHP Code:
    foreach ($_SERVER as $key => $value) { 
      echo 
    "Servervariable : " $key "   Value:" $value "<br />"

    end check the output. If your NT-Accounts username doesn't show up anywhere, then you are out of luck.

    You could also take a look here for some authentication software (bu i think they will all involve a login dialogbox)
    http://www.zend.com/zend/tut/authentication.php
    http://www.hotscripts.com/PHP/Script...uthentication/

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks raf - tried that code but it didn't return my NT username....


    Is there any way to return the username? I can have a choice of servers (the architecture isn't fully up yet)...

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,093
    Thanks
    11
    Thanked 101 Times in 99 Posts
    best bet is to grab an apache NT authentication module and authenticate users that way , check out http://modules.apache.org and search for authentication , I use mod_sspi but its appears no longer supported
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •