C0D3D3V / Moodle-DL

Moodle-DL downloads course content fast from Moodle (eg. lecture pdfs)
GNU General Public License v3.0
417 stars 62 forks source link

Login through OpenID doesn't work #106

Closed underdeadcmh closed 2 years ago

underdeadcmh commented 3 years ago

hey, due to usage of only openID login in our moodle system I see that it is not possible to log in :( can something be done in such a case? thanks

C0D3D3V commented 3 years ago

Can you send me the URL to your moodle? Some moodles with openID have the SSO plugins activated, so you could try the --sso option on initialization.

underdeadcmh commented 3 years ago

it's moodle.ut.ee and --sso didn't work, thx for the fast reply tho

C0D3D3V commented 3 years ago

I have checked your Moodle instance, unfortunately it seems that your instance does not support the moodle app. You could contact an administrator of your instance and ask if they plan to enable the moodle app soon, you could suggest in your mail that the app is very helpful.

C0D3D3V commented 3 years ago

Oh oops I was wrong, I missed something. Wait, I can explain how to use the downloader.

C0D3D3V commented 3 years ago

Do you use https://moodle.ut.ee/auth/oidc/ or https://moodle.ut.ee/auth/est_id_card/login.php to log in?

C0D3D3V commented 3 years ago

Regardless, you can try this: https://github.com/C0D3D3V/Moodle-Downloader-2/wiki/Copy-a-token-from-the-Moodle-app

underdeadcmh commented 3 years ago

I am using the https://moodle.ut.ee/auth/oidc/ Tried getting token as described and even got it, decoded, failing at downloading account info with 404 upd: ok so if I am refreshing this empty page after login through openID where I am getting the token, I'm being automatically redirected to my moodle but with opening sub-page "Unknown state".

C0D3D3V commented 3 years ago

I forgot that the method I explained in the wiki doesn't quite work on openid because chrome doesn't redirect to the app. I'll rewrite that so it works there too.

Basically you just have to install the real Moodle Desktop app (https://download.moodle.org/desktop/) and do the same. On Arch Linux you can just install it from the AUR (moodledesktop-bin). On Windows you can download it from the microsoft store or from pcmacstore. The app uses Electron8 and correctly handles the redirection. Start the app in the terminal with moodledesktop --debug (on windows you have to replace moodledesktop with the path to the app if necessary). Alternatively you can use env ELECTRON_ENV=development && moodledesktop under Linux or set ELECTRON_ENV=development && moodledesktop under Windows. Then open the debug consol with [Ctr + Shift + I] and activate the "Preserve log" checkbox in the Network tab. Then keep going like in the wiki article described.

C0D3D3V commented 3 years ago

Which operating system do you use?

underdeadcmh commented 3 years ago

Gonna try the other method later, thanks. It's kali with linux 5.9.0 kernel

C0D3D3V commented 3 years ago

Linux download Link for moodle dektop: https://download.moodle.org/desktop/linux/moodledesktop-linux-64-v380.tar.gz You have to unzip the tar.gz tar -xvzf moodledesktop-linux-64-v380.tar.gz , then you can make the AppImage executable and run it ./linux-x64.AppImage --debug, here is a tutorial: https://itsfoss.com/use-appimage-linux/.

Alternatively you can use a PKGBUILD to install it.

Windows download link for moodle desktop: https://download.moodle.org/desktop/windows/moodledesktop-windows-v380.zip

C0D3D3V commented 2 years ago

I updated the wiki entry: https://github.com/C0D3D3V/Moodle-Downloader-2/wiki/Copy-a-token-from-the-Moodle-app

I hope this helps