Authentication: User key authentication

Maintained by Picture of Catalyst ITCatalyst IT, Picture of Dmitrii MetelkinDmitrii Metelkin, Picture of Brendan HeywoodBrendan Heywood, Picture of Marcus BoonMarcus Boon, Picture of Adam RiddellAdam 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.
330 sites
29 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.


Read plugin documentation.


Screenshot #0


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
    Mon, Sep 11, 2017, 8:01 AM
    Hi Sai Prasad,

    Yes, you should redirect a user to{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:
  • Picture of sai prasad
    Mon, Sep 11, 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, Sep 12, 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
  • Picture of Vincenzo Sorrentino
    Wed, Mar 21, 2018, 10:17 PM

    I've configured the "user_auth_authentication" plugin in moodle 3.4.1, I'm able to do SSO from external authentication but if I set in settings "Create User" to 'On' and I login in moodle (E.g using link the user is created but have the confirmed flag to 0. Is possible to confirm the user during create (or update) in the plugins?

    Best Regards
  • Picture of deva m
    Fri, Aug 24, 2018, 4:41 PM
    hi dmitrii,
    1.suppose if i use 2 moodle application to perform sso between them, where i need to write the script to interact with plugin. locate me to the folder details within moodle...
    2. moodle without auth_key plugin is the web application and the another one is moodle is that right ?
    3. 'get_login_url' under auth.php in user key authentication plugin is responsible for generating login key... is that right?
  • Picture of Catalyst IT
    Mon, Aug 27, 2018, 8:31 AM
    Hi deva m ,
    I'm not sure what sort of support you are trying to get here, but If you have any questions about the plugin code please use github and raise a new issue with your question(s) We will try to ask all your questions if possible. Also if you are looking for a way to connect two Moodle instances without writing any code, you would probably want to have a look at MNet or LTI set up.

  • Picture of deva m
    Mon, Aug 27, 2018, 4:42 PM
    thanks dmitrii !
    as new to PHP coding, i don't know where to write the code in external web application to make a web call, can you suggest me where do I write it ?

    Best Regards
  • Picture of Dan Marsden
    Tue, Aug 28, 2018, 7:50 AM
    Hi Deva, this is the wrong place to ask for that sort of help. please create a new post in the community forums here on - Good luck!
  • Picture of Steve Maher
    Mon, May 13, 2019, 9:12 PM
    We are using auth_userkey on moodle 3.5 Linux (ubuntu) and it is working great. One issue that we are facing is that when a user on our site clicks on a link to the moodle site, the site successfully gets a token and logs in but when the user account is then created on that moodle site, "auth_forcepasswordchange" is set as a user preference which then results in an error message: "You cannot proceed without changing your password, however there is no available page for changing it.". Have you had other reports of this issue? Any recommendations on resolving ? One way to kind of hack past the issue is to edit several file on the moodle server that have "set_user_preference(‘auth_forcepasswordchange', 1, $user)" and hard code that to "set_user_preference(‘auth_forcepasswordchange', 0, $user)". I cannot find a moodle setting that turns off setting "auth_forcepasswordchange" to true in the mdl_user_preferences table.

    Ideas/recommendations would be super helpful and thank you so much in advance for any help you might be able to provide.
  • Picture of Nilesh Pathade
    Sun, May 26, 2019, 7:33 PM
    HI I am using same plugin, but after getting loginurl, I am unable to redirect.


    It's not working please help me
  • Picture of AMC Academic Moodle Cooperation
    Tue, Jun 4, 2019, 4:14 PM
    Hey Steve, have you resolved your issue or did you get any response from the developers of the plugin. We would like to use the plugin for our newest 3.6 Moodle version.
    Any recommendations on how to proceed?
    Thanks - Kasia
  • Picture of Promise Ogechi Izuagbala
    Sun, Jun 9, 2019, 8:12 AM
    Hello Team. Thanks for the wonderful plugin. I made a mistake of installing the plugin on my production server and my moodle site stopped working. As a debugging step I want to uninstall the plugin but I can find any instruction online that shows how to uninstall the plugin. Please urgent help will be appreciated.
  • Picture of Upendra M
    Mon, Jun 17, 2019, 8:09 PM
    I am not able to update user key plugin config data. during plugin installation it saves the data but next time during config data update it never update the data.
  • Picture of Marini Marini
    Tue, Jul 9, 2019, 7:43 PM
    Hi good morning,
    It is posible pass the field city or a custom field?
  • Picture of Dmitrii Metelkin
    Wed, Jul 10, 2019, 5:39 AM
    Hi Marini,
    In the current implementation it's not possible to pass the field city or a custom field. But feel free to submit a feature request in github
1 2 3
Please login to post comments