views:

131

answers:

1

The idea of unified authentication behind a single API like PAM is very attractive to me. However, PAM seems to be more oriented toward shell authentication and offer a rather limited set of features from its API and require system-wide configuration from a file.

I'm looking for something like this for a CGI (C language) web interface that authenticate users using Radius, or with a Postegresql. At the moment, different code is used for one or the other. In the future, it would be nice to extend the set of authentication mechanisms to LDAP, windows active directory, mysql etc. but implementing them all by hand would be long and painful.

So libpam still is the winner, but the main problem is that additional information other than just login, name, password or home directory must be recorded. Also, file configuration must be avoided. Preferably, the user should configure everything from the program's own configuration file. Finally, small footprint is important as it is intended for an embedded application and high level languages such as perl, python, php are avoided.

How would you deal with that ?

+1  A: 

I'm not certain this applies to your problem, but have you considered using a SASL library? I've had good experiences with Cyrus SASL.

rampion
Thanks for you comment. I didn't know about it. From what I understand, SASL is used to negotiate a security layer between a client and a server. So given a SASL compatible server, one could authenticate against it without having to worry about what is running behind (pop3, ldap ...). Interesting.
pierrelucbacon