Authentication: User key authentication

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.
230 sites
25 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 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 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?

  • 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 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

  • 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???
    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{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, 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
  • Picture of Vincenzo Sorrentino
    Wed, 21 Mar 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, 24 Aug 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, 27 Aug 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, 27 Aug 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, 28 Aug 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!
1 2
Please login to post comments