Unfix Logo

Projects :: FuzzAuth

Introduction

FUZZauth came to live when I needed a simple but secure distributed authentication mechanism for a project.

As I decided to use a postgreSQL backend I first tried to use pam_pgsql and friends, but the biggest problem of that configuration was the fact that the username&password has to be known by the userland utilities to perform an authentication. Next to that, installing postgresql libraries and allowing all the clients to connect directly to the database with a cleartext connection is simply insane.(Of course one can tunnel it through SSL etc... but yaddayadda...)

What it is (or at least aims to be):

What it isn't:The general idea:
The General idea

Copyright Information

The code for FUZZauth was written by Jeroen Massar <jeroen@massar.ch>
The copyright for this package is owned by Jeroen Massar <jeroen@massar.ch>
(C)2002-2005 Jeroen Massar <jeroen@massar.ch>
You should have found a copy of the GNU Public License in this archive,located in the 'doc' directory, and it is called LICENSE.

Where to get it

The latest tarball can be found here: fuzzauth-2002-02-12.tgz.

Compiling and installing

vi /etc/pam.d/service> and add:
8<-----------------------------------------
auth sufficient pam_fuzzauth.so
account sufficient pam_fuzzauth.so
password sufficient pam_fuzzauth.so
session sufficient pam_fuzzauth.so
----------------------------------------->8
You will probably want to put these after stuff like nologin/env/lastlog/motd/mail etc... But before 'required's of pam_unix. Note also that when the deamon doesn't run it returns directly so it should be possible to login into system accounts at any occasion. For password you should add:
8<---------
password sufficient pam_fuzzauth.so
--------->8
And add 'use_first_pass' for the other modules so they won't ask for a password when the user isn't specified by fuzzauth.
/etc/nsswitch is even easier:
8<-----------
passwd: compat fuzzauth
group: compat fuzzauth
----------->8
Which would do the trick. FUZZd is fully nscd compatible and it does save some db queries too ;) Of course don't forget to restart it when you editted the config. The next step is to configure FUZZauth to use the correct authenticator plugin. Don't forget to configure the plugin too so it knows where to find it's data.

Compiling and installing php_fuzzauth.so

Change the PHP_SOURCE value in the Makefile and set it to the root of your PHP source tree. For debian use apt-get source php4 and set it to the dir of the unextracted tarball. Probably any version matching the ZEND_VERSION will do. Compile and install it into the correct directory, then add:
8<------------------------
extension=php_fuzzauth.so
------------------------>8
to php.ini (/etc/php4/apache/php.ini and /etc/php4/cgi/php.ini on debian ;) Now restart your apache or call a php through the cgi edition and check php_info() which should show the FUZZauth version, otherwise check your error logs for hints. Now all your php code can use:
bool fuzzauth_Authenticate(sUsername, sPassword)
bool fuzzauth_ChangePassword(sUsername, sPassword)
bool fuzzauth_UserExists(sUsername)
For example:
<?php
/* FUZZauth - http://unfix.org/projects/fuzzauth/
* fuzzauth.php - Example FUZZauth functionality with PHP by Jeroen Massar >jeroen@massar.ch>
*/

$name = "fuzzel";
$old = "currentpass";
$new = "newpass";

if (fuzzauth_UserExists($name)) { echo "User found<br />"; if (fuzzauth_Authenticate($name, $old)) { echo "User authenticated correctly with old password<br />"; if (fuzzauth_ChangePassword($name, $old, $new)) { echo "Password changed succesfully.<br />"; } else echo "Changing password failed.<br />"; } else echo "Authentication failure.<br />"; } else echo "User doesn't exist.<br />"; ?>

Interfaces

These are the interfaces used by the system

Packet Encryptors

xClient->m_Encryption
- compile time or library based...
Encryptors:
©1997-2014 Jeroen Massar