Authentication: User key authentication

auth_userkey
Maintained by Picture of Catalyst IT Catalyst IT, Picture of Dmitrii Metelkin Dmitrii Metelkin, Picture of Brendan Heywood Brendan Heywood, Picture of Marcus Boon Marcus Boon, Picture of Adam Riddell Adam Riddell
Log in to Moodle using one time user key based login URL. Auth plugin for organising simple SSO (single sign on) between moodle and your external web application.
95 sites
112 downloads
16 fans

Log in to Moodle using one time user key.

Auth plugin for organising simple one way SSO(single sign on) between moodle and your external web application. The main idea is to make a web call to moodle and provide one of the possible matching fields to find required user and generate one time login URL. A user can be redirected to this URL to be log in to Moodle without typing username and password.

The plugin supports user provisioning.


Using

Read plugin documentation.

Screenshots

Screenshot #0

Contributors

Picture of Catalyst IT
Catalyst IT (Lead maintainer)
Picture of Dmitrii Metelkin
Dmitrii Metelkin
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Dmitrii Metelkin
    Fri, 7 Jul 2017, 8:01 AM
    Hi Marwan Salem,

    It usually depends on what sort of integration are you after. This plugin is ideally for organising SSO with your application and moodle.

    Very simple scenario:
    1. Install and configure auth_userkey plugin for your moodle.
    2. Create a script in your web application to interact with moodle auth_userkey plugin to generate login key for users and redirect them to moodle.
    3. Put some link in your web application to let users to click on it and execute the script from step 2.
    4. Profit.

    Look at documentation to find some PHP code examples for testing https://github.com/catalyst/moodle-auth_userkey/blob/master/README.md

  • Picture of Brendan Heywood
    Fri, 7 Jul 2017, 8:31 AM
    hi Marwan,

    Your requirements are very open ended, and there are many out of the box solutions, ie SAML, CAS, Auth2 etc which could make the integration easier. This plugin may or may not be the best solution.

    If you would like commercial help please contact us:

    https://www.catalyst-au.net/contact-us
  • Picture of Simon Brenner
    Mon, 10 Jul 2017, 8:56 PM
    Hi,

    the plugin page says that this plugin is compatible with Moodle 3.3 - but as the comment on GIT hub

    https://github.com/catalyst/moodle-auth_userkey/issues/15#issuecomment-306955454

    points out, its currently not working with 3.3. The version info on this page should be corrected to save users some hassle.
  • Picture of Brendan Heywood
    Tue, 11 Jul 2017, 7:29 AM
    thanks Simon I have just fixed that metadata.
  • Picture of Sai Prasad
    Thu, 31 Aug 2017, 2:24 AM
    im getting error when trying to install this: below is the detail:

    Stack trace: •line 513 of \cache\classes\definition.php: coding_exception thrown
    •line 515 of \cache\classes\helper.php: call to cache_definition::load()
    •line 480 of \cache\classes\helper.php: call to cache_helper::purge_store()
    •line 1737 of \lib\upgradelib.php: call to cache_helper::purge_all()
    •line 683 of \admin\index.php: call to upgrade_noncore()


    can any one help??
  • Picture of Sai Prasad
    Thu, 31 Aug 2017, 2:25 AM
    it says coding error
  • Picture of Dmitrii Metelkin
    Thu, 31 Aug 2017, 8:08 AM
    Hi Sai Prasad,

    It's really hard to say what is broken based on your description as trace you attached is related to some errors in cache class. If you do believe that this error is triggered by auth_userkey plugin please feel free to create an issue in https://github.com/catalyst/moodle-auth_userkey Please provide more details for us to replicate it (Moodle version, any specific settings and etc)

    Also, have you tried to install other plugins? Maybe it's a just general error you are getting for any plugin?

    Thanks,
    Dmitrii
  • Picture of Sai Prasad
    Fri, 1 Sep 2017, 12:42 AM
    I went through and deleted config file under muc folder , it worked thanks for your help.
  • Picture of Sai Prasad
    Fri, 1 Sep 2017, 12:58 AM
    installed plugin successfully ,using this user cannot directly login using moodle login page right?

    could you give me an example of how to call from external application ?, as I'm using asp.net application
  • Picture of Dmitrii Metelkin
    Fri, 1 Sep 2017, 9:47 AM
    Hi Sai Prasad,

    That's correct, users who have this auth method set can't login directly to moodle.
    Unfortunately I'm not able to provide any .NET examples. You can find a PHP example in the plugin docs https://github.com/catalyst/moodle-auth_userkey/blob/master/README.md

    Cheers,
    Dmitrii
  • Picture of sai prasad
    Sat, 9 Sep 2017, 2:20 AM
    Thank you so much for your response, i have one question , when Im calling from external application i need to call login page under auth folder right? and pass the token generated for that particular user???
    https://mywebsite.com/MoodleN/auth/userkey/login.php?key=016cf7820ba16fd7c1850a91887f9a6d
    please let me know
  • Picture of sai prasad
    Sat, 9 Sep 2017, 4:30 AM
    im trying to run the code given in the github but i dont see any response, could you give me full code including libs so that i can try to run.
  • Picture of Dmitrii Metelkin
    Mon, 11 Sep 2017, 8:01 AM
    Hi Sai Prasad,

    Yes, you should redirect a user to https://mywebsite.com/MoodleN/auth/userkey/login.php?key={unique key returned by web service call} If all good, the user will be logged in to Moodle.

    It's really hard to say why you don't see any response without having all details about your configuration. As it could be a variety of reasons. If you would like commercial help please contact us: https://www.catalyst-au.net/contact-us
  • Picture of sai prasad
    Mon, 11 Sep 2017, 11:00 PM
    Thank you and one last question , do i need to configure webservice in moodle or external app ?? like if i want to map email address like this....
    [user] => Array
    (
    [email] => string
    )

    should i create in moodle?

    this is my last question , please suggest thanks.
  • Picture of Dmitrii Metelkin
    Tue, 12 Sep 2017, 8:01 AM
    Hi Sai,

    You surely need to configure your Moodle to enable webservices and then to set required mapping for auth_userkey. Some documentation regarding Moodle web services could be found here https://docs.moodle.org/33/en/Web_services
1 2
Please login to post comments