Authentication Plugin using Atlassian Crowd

Authentication Plugin using Atlassian Crowd

by Ivan Kovnatsky -
Number of replies: 2

Hi fellas,

I'm developing a plugin, which would let us connect to our moodle site using Atlassian Crowd credentials.  So far, I developed first part, where user logs in moodle site, entering his/her credentials.  As I understood, moodle creates a new user with auth='crowd' type.

After user logs in, the first page is shown to him/her is profile page, where all data is empty, so the user should fill it up by himself.

Could you suggest, which way should I pick here:

* write a pre-sync users from Crowd, so that when a user logs in all data was in place with confirmed email and so

* or write user_authenticated_hook($user, $username, $password) so that a newly created user's data was populated right after it was created.

For testing I wrote this one, which looks pretty ugly:
----

    //function user_authenticated_hook(&$user, $username, $password) {

    //    global $DB;

    //    $transaction = $DB->start_delegated_transaction();


    //    $sql = "update mdl_user

    //               set firstname=:fn,

    //                   lastname=:ln,

    //                   email=:em,

    //                   city=:ci,

    //                   country=:co,

    //                   confirmed=:cf

    //             where 1=1

    //               and username='$username'

    //    ";


    //    $DB->execute($sql, array(

    //        'fn'=>$this->employees[$username]['firstname'],

    //        'ln'=>$this->employees[$username]['lastname'],

    //        'em'=>$this->employees[$username]['email'],

    //        'ci'=>$this->employees[$username]['city'],

    //        'co'=>$this->employees[$username]['country'],

    //        'cf'=>1,

    //    ));

    //    $transaction->allow_commit();

    //}

----

Thanks,

Ivan.

Average of ratings: -
In reply to Ivan Kovnatsky

Re: Authentication Plugin using Atlassian Crowd

by Jean-Baptiste CROUIGNEAU -

Hello Ivan,

I'm really interested by this plugin.

I found it on github, but is it working ?

I tried to follow your installation instructions, but I think some steps are missing.

Do I have to manually configure the plugin ?

Should the plugin be visible in my Moodle plugin list ?

Where can I declare that Moodle have to use this specific plugin for authentification ?


In reply to Ivan Kovnatsky

Re: Authentication Plugin using Atlassian Crowd

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Take a look at the LDAP auth plugin. It is dealing with similar issues to fetch user details from the LDAP.