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 3 of 3
  1. #1
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    378
    Thanks
    9
    Thanked 39 Times in 39 Posts

    Question Authenticate against LDAP and sync with MySQL

    I have built an application in PHP/MySQL. To access it, users log in against a users table in MySQL. That all works fine.

    Now there is a possibility we will be asked to authenticate against an LDAP server.

    I have written a script that can search for a user in an LDAP server.

    However, if I get a successful return from LDAP how do I link all the other tables in the Database (that were originally linked to the users table) to the LDAP user?

    Any help is appreciated.
    Regards, Stooshie
    O

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Create an aliasing between an LDAP user and its MySQL user equivalent. This will take a new table to establish the relationship between the current mysql user and its ldap account (can you get the sid from an ldap, or maybe just stuck with dn). Then write an adapter to stand between the mysql account and the ldap account which is capable of resolving a ldap name as a mysql id. This can now be used to associate anything owned by the mysql user with the ldap user.
    If you're OO, its likely that this will only take a few minutes. If you're procedural, I'd expect it to take a lot longer.

  • Users who have thanked Fou-Lu for this post:

    Stooshie (09-21-2011)

  • #3
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Location
    Dundee, Scotland
    Posts
    378
    Thanks
    9
    Thanked 39 Times in 39 Posts
    Thanks Fou-Lou. Will try that.
    Regards, Stooshie
    O


  •  

    Tags for this Thread

    Posting Permissions

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