nextcloud / integration_moodle

🎓 Moodle integration into Nextcloud
GNU Affero General Public License v3.0
15 stars 5 forks source link

Login via SSO #7

Open marvinjuette opened 3 years ago

marvinjuette commented 3 years ago

Hey I want to connect the moodle integration with moodle of my university. But I have to use my uni account via sso to login to moodle. I didn't find the option in this app.

It would be great if that would be added.

MarcCeleiro commented 3 years ago

Totally agree. Many Moodle sites work under SSO authentication and it makes this plugin useless in many cases... :disappointed:

julien-nc commented 3 years ago

Hi there.

Are you able to authenticate to your Moodle instances with Moodle official mobile app?

As far as I know, there is no documented way to authenticate via the API if the Moodle instance uses SSO. But if the mobile app can do it, it might be worth checking how it does it and try to do the same in this integration app...

MarcCeleiro commented 3 years ago

Hi @eneiluj! Yes, I can log in without problem. Instead of seeing the default login of the app, the login screen of my university is displayed. I have found this video of the old version of Moodle Mobile, although the steps are exactly the same in the new version. https://www.youtube.com/watch?v=cl8rsyyyg9g

Ge0rg3 commented 3 years ago

Hi guys, if anyone's interested I found a temporary workaround until this is implemented --

  1. Visit https://MOODLE_URL/user/preferences.php and click "Security Keys"
  2. Copy the security key used for the app (Moodle mobile web service) or similar
  3. Open your nextcloud db and run this command (with your username and token):
    INSERT INTO oc_preferences VALUES ('USERNAME', 'integration_moodle', 'token', 'TOKEN');
  4. Revisit the dashboard and the notifications now show :)
Migsi commented 3 years ago

I was hitting the same issue right now when I was trying to enable it for my university account on my nextcloud instance. As the plugin describes, it only requires the credentials once to generate a session token (which then is kept alive forever I guess?). So it might be helpful to add an input field which allows users to paste a valid session/access token, performing similar steps as @Ge0rg3 suggested. This way we'd have a quick workaround and don't require users to tinker around in their databases manually.

deverickapollo commented 2 years ago

Confirming method suggested by @Ge0rg3 worked with my uni account. Agree with @Migsi here - adding a field to input the key may be a simple fix here.

mirenbz commented 1 year ago

Just to confirm that the problem persists and the method suggested by @Ge0rg3 keeps working at least. Thanks @Ge0rg3 !

provokateurin commented 1 year ago

@julien-nc How about implementing a way to add a token directly from the UI? I think this should even replace the current method as you won't have to send your username and password anymore which is a bit safer.

julien-nc commented 1 year ago

@provokateurin If there's a way to get a token in Moddle's UI then why not. Also, do you know if this would work on instances using SSO? Then it would be a simple way to support SSO :grin:

provokateurin commented 1 year ago

I think that's what people here have been using to get SSO working.

julien-nc commented 1 year ago

Let me reformulate: Are we sure getting a "security key" in Moodle can always be done, in all instances? Question is for everybody here :grin:

I wanna make sure this new authentication method will not break the integration with some Moodle instances.

C10udburst commented 1 year ago

Let me reformulate: Are we sure getting a "security key" in Moodle can always be done, in all instances? Question is for everybody here

image

Doesn't seem to be available for me

provokateurin commented 1 year ago

@C10udburst this is on an instance with SSO or not?

C10udburst commented 1 year ago

@C10udburst this is on an instance with SSO or not?

yeah, it's on an instance with SSO

provokateurin commented 1 year ago

I guess there is no way to support that scenario :/

But it probably means this can be the case for non-SSO instances, thus we need to keep the current method working.

dharmikvyas commented 5 months ago

any solution?? I am also not seeing "security key" in moodle user preferences.. I have SSO setup alreaady and I have both option to login manually as well with sso and it's working fine with moodle as well as nextcloud...