PAM (Pluggable Authentication Modules) for Moodle

PAM (Pluggable Authentication Modules) for Moodle

by Martin Vögeli -
Number of replies: 10

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: -
In reply to Martin Vögeli

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of 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.
 
In reply to Martin Dougiamas

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Vögeli -

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!

In reply to Martin Vögeli

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Martin, how did you go on the PAM module?
In reply to Martin Dougiamas

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Vögeli -

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
In reply to Martin Vögeli

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
No, just copy one of the other auth modules eg auth/db to auth/pam and edit lib.php in there
In reply to Martin Dougiamas

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Vögeli -

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?

In reply to Martin Dougiamas

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Vögeli -

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

In reply to Martin Vögeli

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of 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.
In reply to Martin Dougiamas

Re: PAM (Pluggable Authentication Modules) for Moodle

by Martin Vögeli -

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