0

I want to create ASP.NET Core MVC app as Moodle external tool. I created tokens for web services. I know that for Moodle web service is necessary to pass token and web service function name.

My question is how to know which user is logged-in in Moodle, and how to get his token or username/password and pass it to Moodle external tool? To get token, I must know username/password, and inversely.

1 Answer 1

0

You want a Moodle user to access your external tool?

If the tool is already added to Moodle web services

And the user has the moodle/webservice:createtoken capability

The user can then get their token/security key by clicking on their user name (usually on the top right)

Then from the drop down menu, go to Preferences > User account > Security keys

And choose the key for your web service

https://docs.moodle.org/403/en/Security_keys

1
  • Thanks for reply. I have this scenario: to create ASP.NET Core MVC app that I will include in Moodle course. Course participants should access the application, which will have one button. At the click of the button, data for that user will be entered in the grid(I will use core_webservice_get_site_info method). And that's why I need a token, to pass it to the api method. Is this possible to implement? If yes, how to do that?
    – Alex
    Commented Apr 24 at 22:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.