Authenticating with mod_auth_ldap

Archived from the Xataface Users forum.

gthorne — Fri Aug 31, 2012 1:55 pm

Hi, I’m on a server that uses .htaccess files and mod_auth_ldap for authentication. So, the authentication is taken care of even before it makes it to the Xataface application. Really, the only need I have for authentication is to track which users made what changes. Do I need to make a whole new Xataface authentication plugin to accomplish this?


shannah — Sat Sep 08, 2012 10:13 am

You don’t necessarily need an authentication module in this case, although you could write one. The name of the logged in user should be accessible to you via the server environment variables.

E.g. Try printing the $_SERVER variable to see where it is (i.e. print_r($_SERVER); )

Once you know how to find out who is logged in, you can use this anywhere in your application instead of using the AuthenticationTool to find the logged in user.

If you wanted to be able to use the authentication tool still (e.g. to add a level of consistency with other apps) you could write an authentication module that would simply return the ldap username as the logged in username.

-Steve


gthorne — Mon Sep 10, 2012 2:38 pm

That’s what I was looking for, thanks Steve!