Linux User Authentication

Discussion in 'PHP' started by lappy512, Feb 28, 2008.

  1. #1
    I've been doing a bit of searching around and I see a lot of builtin PHP functions to authenticate using a LDAP server.

    Is there a method to interface with the Linux authentication to test a user/password against a linux username/password using PHP? I'm going to use Linux to store my user and password database instead of an external server.

    Thanks.
     
    lappy512, Feb 28, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    There's the php LDAP library: http://www.php.net/ldap

    In my experience it's somewhat difficult to work with, but it should work with most LDAP directory structures.
     
    jestep, Feb 28, 2008 IP
  3. Kylratix

    Kylratix Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Two ways to do it:

    1. Query the LDAP server directly using the LDAP library in PHP.
    us3.php.net/manual/en/ref.ldap.php

    2. Use mod_autnnz_ldap in Apache to authenticate and then use the http authentication hooks in PHP to verify.
    httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html
    us3.php.net/features.http-auth
     
    Kylratix, Feb 28, 2008 IP