Authentication

 
 
Picture of Martin Vögeli
PAM (Pluggable Authentication Modules) for Moodle
Group Developers

What happened to PAM (Pluggable Authentication Modules)? I didn't find it in Moodle 1.3.2:

http://moodle.org/mod/forum/discuss.php?d=4524

I tried out IMAP but our PHP 4.3.3 lacks imap_open() and my support is reluctant to install it because it's quite a procedure.

So I might try to program an additional authentication module for PAM support. I already found a PHP4 PAM Authentication module:

http://www.math.ohio-state.edu/~ccunning/pam_auth/

What do you people think? Is it worth a try? Has somebody tried this before?

 
Average of ratings: -
Martin in black and white
Re: PAM (Pluggable Authentication Modules) for Moodle
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Someone did in fact do this once.  

   http://www.spinics.net/lists/pam/msg02838.html

I wrote him and he said the code was really easy - the main part is this in auth/pam/lib.php

if (pam_auth($username, $password, &$error)) {
    return true;
} else {
    return false;
}


which looks like it's using the pam_auth library you found.  If you would like to try and test this I'd love to get it into Moodle 1.4.
 
 
Average of ratings: -
Picture of Martin Vögeli
Re: PAM (Pluggable Authentication Modules) for Moodle
Group Developers

Thanks for your speedy answer. As soon as pam_auth() is installed on our server I'll give it a try. I'd really like to contribute some code - so far I've only profited from free and open source software (FOSS), i.e. phpBB, Mozilla, VirtualDub, ... It's time to give something back!

 
Average of ratings: -
Martin in black and white
Re: PAM (Pluggable Authentication Modules) for Moodle
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Martin, how did you go on the PAM module?
 
Average of ratings: -
Picture of Martin Vögeli
Re: PAM (Pluggable Authentication Modules) for Moodle
Group Developers

My server admin finally installed the PAM module and I'm right now working on it (two hours and counting). I try to figure out how to integrate an authentication module in Moodle. Can I just follow the USING THE NEW MODULE TEMPLATE guide or do I have to do something different or in addition?

http://moodle.org/download.php/modules/NEWMODULE.zip

http://moodle.org/wiki/index.php/WriteANewModule
 
Average of ratings: -
Martin in black and white
Re: PAM (Pluggable Authentication Modules) for Moodle
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
No, just copy one of the other auth modules eg auth/db to auth/pam and edit lib.php in there
 
Average of ratings: -
Picture of Martin Vögeli
Re: PAM (Pluggable Authentication Modules) for Moodle
Group Developers

I've done that and it works now when I'm directly connected to the internet. But I get a strange error and a coredump when I use a proxy server. I'll have a look at the problem with my server admin on Wednesday. I hope we can solve it. I've attached the files I've added or changed so far. Maybe somebody can test it on an other Moodle installation?

 
Average of ratings: -
Picture of Martin Vögeli
Re: PAM (Pluggable Authentication Modules) for Moodle
Group Developers

Now everything works fine (also with Moodle 1.4). How do we proceed?

 
Average of ratings: -
Picture of Martin Vögeli
Re: PAM (Pluggable Authentication Modules) for Moodle
Group Developers

So, how do I get PAM into Moodle? The code is ready and works fine so far.

http://moodle.org/file.php/5/moddata/forum/25/57400/moodle-pam-module-2004-09-01.zip

 
Average of ratings: -
Martin in black and white
Re: PAM (Pluggable Authentication Modules) for Moodle
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
It's in!   1.4.2 and 1.5 dev.

Thank you!  I've assumed this is GPL licensed .. if not please let me know as I will have to remove the code.
 
Average of ratings: -
Picture of Martin Vögeli
Re: PAM (Pluggable Authentication Modules) for Moodle
Group Developers

That's great! Thanks for adding the code to the source. May the Moodle be with you smile

 
Average of ratings: -