Copy a token from the Moodle app - C0D3D3V/Moodle-DL GitHub Wiki
If you are sure that the Moodle app (for Android or IOS) works, but none of the automatic and manual methods work to get a token, there is only one way to get a token directly from the Moodle app!
- First you need to install the moodle desktop app.
Moodle Desktop has been discontinued, but you can still download it :
- for Windows :
- traditional executable installer, version 3.8.0 (courtesy of the WayBack Machine) ;
- or UWP app format (
.appx), version 3.9.2 (courtesy of the MSFT-Store project) ;
- for Linux, , if the WayBack Machine saved any packages, really;
- for Windows :
- Unpack\Install the app from the downloaded archive (on Linux you can run e.g.
tar -xvzf moodledesktop-linux-64-v380.tar.gz; on windows you can use e.g. 7Zip. or just open the.appxfile with windows package installer) - Now start the Moodle Desktop app in debug mode:
- On Linux: Open a terminal in the folder where the app is located and run
./linux-x64.AppImage --debug - On Windows: Install the app and then open a comand line prompt and open the app in debug mode by running:
"%LOCALAPPDATA%\Programs\moodledesktop\Moodle Desktop.exe" --debug(traditional executable installer) or"%PROGRAMFILES%\WindowsApps\3312ADB7.MoodleDesktop_3.9.2.0_x64__t8q4t8fsbshw4\app\Moodle Desktop.exe" --debug(Alternatively you can specify the--debugparameter during the installation via the traditional executable installer :D This will open the app in debug mode right after installation)
- On Linux: Open a terminal in the folder where the app is located and run
- Open the developer console by pressing [Control+Shift+I]
- Go to the Network tab, as shown in the screenshot
- Login to your moodle account like you did on your phone
- Wait till the website is loaded and then scroll down the list of requests till you see requests starting with "
server.php?" link in this image:

- Select one of these requests that starts with "
server.php?". On the right side of the window you will now see a lot of information about the request. - Select the
Headerstab and scroll down till you reach theForm Datasection. - There you see the data that was send from the app to the server, one of the data is the
wstoken, this is the token we need:

- Finally copy the
wstokenand create aconfig.jsonfile in a folder where you want to download the moodle files. In theconfig.jsonfile paste the following:
{
"token": "06eab0your_copied_token36a492",
"moodle_domain": "moodle.ruhr-uni-bochum.de",
"moodle_path": "/m/"
}
Replace the moodle_domain with the domain of your moodle server and the moodle_path with the installation path of the moodle (often it is just /).
Now you are ready to go! You can start the downloader in the folder where you created the config file.
P.S. : Mind you, you might finally want to uninstall moodle desktop client due to the fact it's a discontinued electron-based program, therefore it certainly suffers from several (unpatched) vulneralibities of wide-ranging severity.