Moodle 3.4 Office365 sign on

Moodle 3.4 Office365 sign on

by Peter Koel -
Number of replies: 19

Hi Friends,

   I have been able to get the Office 365 login to work with our Moodle instance. How do I disable, or suppress, the default Moodle log in screen? All I want my users to see is the Microsoft Office 365 button. I appreciate your suggestions!


Cheers!


Peter


Average of ratings: -
In reply to Peter Koel

Re: Moodle 3.4 Office365 sign on

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Why on Earth...? Don't do it. You will have to hack core code to get that to work I suspect, and that is something that often has an unhappy outcome. 

<remoteconnection>As an aside, why use something from the Dark Side? I am sure you have your reasons, but they are still playing catch up with Google Docs. OK, GD may not be brilliant at times, but O365..... ummmmmmm by far the largest number of comments I get are "not worth the drama" types of comment. Also, just to declare an interest, I am indifferent or outrightly opposed to the business models of both the Dark Side and Crapple. I prefer instead the idea that if you spend money to purchase something, you should be able to do what you want with it, including  change code, copy and give it away, resell it or delete it altogether. Your choice, not the manufacturers, you own the product with full rights like any other property you pay for, not just the privilege of having a license you can't do much with.  </end>

 

Average of ratings: Useful (2)
In reply to Colin Fraser

Re: Moodle 3.4 Office365 sign on

by Peter Koel -

Hello Collin,

   Thank you for the fast reply. My company has migrated from the desktop version of Office to the Office365 cloud. Because of this move, I now have access to a huge storage space on the Microsoft Stream platform. If I move my videos from my Moodle system and just link to them on the Stream service, I can cut my Moodle storage requirement by two-thirds. The issue with moving the videos to Stream, is that when I link to them, the user is prompted to sign in to the Office365 service. They would have to use one ID for the Moodle log in and a separate log in for the Stream service. If I migrate the Moodle login to Office365, I can reduce the number of sign on prompts. 

By going this route, I hope to reduce my Moodle storage needs (and the associated costs) as well as the number of log ins the user will be prompted for. Is there a better way?

Sincerely,

Peter

In reply to Peter Koel

Re: Moodle 3.4 Office365 sign on

by C Behan -

Hi Peter,



You could use CSS to hide the fields for the usual username and password fields. It would be something like: .loginbox .loginsub {   display: none;}

Alternatively, check out the log in for this Moodle site: https://moodle.griffith.ie They direct staff and students to their authentication system, and direct other users to the traditional Moodle login.


Another possible option is to follow the example NCI. Go to https://www.ncirl.ie/ and scroll to the bottom - there they direct their student to their 'student portal' which is basically https://portal.office.com/myapps. They will have added a custom tile for Moodle which appears under their regular Office app tiles.



Catherine

In reply to Peter Koel

Re: Moodle 3.4 Office365 sign on

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Ahh that makes sense, but as a proponent of Open Source, I have to admit to an anti-Dark Side and Crapple prejudice. I am always proposing OS solutions but sometimes....mmmm Still I wonder how long they will tolerate a lot of videos. Wouldn't  your own private channel on YouTube be a better solution again? smile 

In reply to Colin Fraser

Re: Moodle 3.4 Office365 sign on

by C Behan -

Hi Colin,


I understand your 'anti-Dark Side and Crapple prejudice' big grin! However, if we put those aside, there are benefits to getting students and staff to log in to their 365 profiles (if you're using it in your institution of course). Students will be able to access their OneDrive as a repository when uploading assignments for example. Re Microsoft Stream - if you use that as your video platform then you can restrict your videos to users within your institution by default. The users' photos can be synced from their 365 profiles. You can put users in to Moodle cohorts based on fields on their 365 profiles. And I think there will be more benefits down the line.


Catherine

In reply to C Behan

Re: Moodle 3.4 Office365 sign on

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Hi Catherine, thank you, all this is new information for me, never bothered with it - really not a good idea I am thinking. Sooner or later someone I am talking to is going to ask for this sort of info, and at least I can say "Well, funny you should ask...." now. smile As yet, in some parts of my home State, the horseless carriage is still considered wild innovation and computers are the Devil's work. (OK, a slight exaggeration, but you get the idea.) Leaving Microsoft and venturing into unknown waters is just so scary for many of decision makers. So if I at least sound like I know what I am on about, they might actually listen. They won't understand, but they will listen..clown


In reply to C Behan

Re: Moodle 3.4 Office365 sign on

by Brad Nielsen -

Hi Catherine, do you know if its possible to sync Cohorts using LDAP at the same time as using Office 365?

We are using School Data Sync to automate the creation of courses and enrolment into those courses. It would nice if Office 365 School Data Sync would also create Cohorts, at the same time as it built Courses.

regards,

Brad


In reply to Peter Koel

Re: Moodle 3.4 Office365 sign on

by Ken Task -
Picture of Particularly helpful Moodlers

You need at least two accounts to be able to login to the moodle without using any other authentication method.  IF, the system providing remote authentication is ever off line/down or there is some network hickup, no one will be able to login to the moodle. 

User ID 1 is the guest account ... even if you don't allow guest access, leave the guest user in mdl_user. 

User ID 2, is the original installer person ... that is a manual account ... many have left the default user name to 'admin' when installing initially.  And if you haven't done so, create another manual account  that does not use external authentication and that is also set to one of the admin level users.

Thus, leave the login form for manual accounts ... do display the o365 button to login, however.  If you need to make it clearer for users, edit the language files related to login screen.

'spirit of sharing', Ken



Average of ratings: Useful (1)
In reply to Peter Koel

Re: Moodle 3.4 Office365 sign on

by Michael Haynes -

Hi Peter, you have a few options, anyone feel free to let me know if some or all of these are a bad idea.


1. Link your students directly to https://yourmoodle.com/auth/oidc/

This doesn't actually suppress the login page (going to yourmoodle.com will bring up normal login page) your user will just land on the MS login page and then redirected to Moodle after login if navigating to https://yourmoodle.com/auth/oidc/.

2. Hide everything with css or edit mustache file (hiding with css you have the option to edit with document inspector and reenable form if for whatever reason admin needs to use login via original form.)

3. Create alternative page (found under admin > manage authentication).  This seems to be what Griffith have done with the example mentioned earlier.


The thing to keep in mind is how linking directly to courses, categories etc. works with login flow.  Option 1 probably does not handle this very well.

In reply to Michael Haynes

Re: Moodle 3.4 Office365 sign on

by Peter Koel -

Team,


Thank you for the suggestions! I am going to try and mask the log in with CSS. 


Cheers,


Peter

In reply to Peter Koel

Re: Moodle 3.4 Office365 sign on

by C Behan -

Hi Peter,


Before you do that (even though I suggested it) - maybe take heed of Ken's warning. Is there a backup plan for you to get in to Moodle if you can't log in because for some reason the connection has failed between O365 and your Moodle?


In reply to C Behan

Re: Moodle 3.4 Office365 sign on

by Ken Task -
Picture of Particularly helpful Moodlers

@C Behan .... ya know, sometimes folks learn best the 'hard way'.

Help an entity that uses SAML2 authentication and it's been a hoot to watch.  Sad really.

So let's say OP chooses suggested Number 1 ... direct link somewhere.

Does the server to which all would authenticate *know* if the moodle is in the maintenace mode or down for some other reason?   Don't think that condition/senario is checked by the remote authentication system.

Number 2 .... hide everything with css .... is that done via Moodle setup via Moodle Admin?  If that's true, then one has to edit a table in the DB.   How about hacking code (never a good idea)?   Then to get back the manual/admin login one has to access the server in some other fashion and comment out the code?    Hmmmm having to 'work to work' there!

Besides that .... a changed file (hacked for css) must be documented ... depending upon how the OP does updates to Moodle and upgrades and how often the OP makes sure the Moodle is 'secure' and 'up to date', hacked files might be lost .... you then have to hack them again or re-create the alt login pages.

Number 3 ... same thing as #2 when OP updates or upgrades site.

Changing the Language is done by changing what's default in the DB.   Not dependent upon any particular theme or file.

When one updates or upgrades, one backs up the DB .... hmmmm ... even if I had to 'rollback the site' (restore the site for some reason) this login situation hasn't changed.  Don't have to do or remember to do anything special.

Left column title clearly says 'Admin Logins Only'.   Right column title clearly says 'Students/Faculty - Your Login Below' - and the verbage of what's there in the right column might include who to contact and how if they can't login - or get a CloudFlare error, like what happens with these forums from time to time .... etc.  If students/faculty get confused about that ... well, what can I tell ya. :|

2 cent advice ...

'spirit of sharing', Ken


In reply to Ken Task

Re: Moodle 3.4 Office365 sign on

by Michael Haynes -
There is no need to edit the database if you are using css to hide the panel.


ctrl + shift + i  when in chrome to bring up dev tools and edit the css. 



Attachment login2.PNG
Attachment loginbox.PNG
Average of ratings: Useful (1)
In reply to Michael Haynes

Re: Moodle 3.4 Office365 sign on

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, so you've edited a file.   Where is that file stored?

The OP upgrades to 3.5.+ or skips that version and upgrades to 3.6 when released .... how does OP upgrade and retain the edited file?

Just sayin' that's one of those little things OP might not remember 1-2 years from now.

'spirit of sharing', Ken



In reply to Ken Task

Re: Moodle 3.4 Office365 sign on

by C Behan -

Hi Ken,


You can edit the CSS in the UI. It will be in the theme settings.

Catherine

In reply to C Behan

Re: Moodle 3.4 Office365 sign on

by Ken Task -
Picture of Particularly helpful Moodlers

Thanks for clarification/correction, Catherine.   Yes ... am not 'theme tweak aware' ... more a minimalist.

So if it's editable in the UI, that means it's in the DB .... mdl_config_plugins table?  

And a question .... changes like the one we are discussing go across all themes on the site?   So if OP changes to Essentials theme from one of the core themes then the behavior/display is the same?

'spirit of sharing', Ken


In reply to Ken Task

Re: Moodle 3.4 Office365 sign on

by Just H -
"And a question .... changes like the one we are discussing go across all themes on the site? So if OP changes to Essentials theme from one of the core themes then the behavior/display is the same?"


Normally, no i.e. if you add custom CSS it's to a specific theme.