Custom Login Page in Moodle 3.2

Custom Login Page in Moodle 3.2

by Umar Farooq -
Number of replies: 6

Hello,

I have successfully implemented the SSO using Oauth2 and "Log in with Google" button is dosplayed on log in page. On log in page for users I only want to show the  "Log in with Google" button and hide log in form. A solution like given in this post https://moodle.org/mod/forum/discuss.php?d=261950 . But, in moodle 3.2 moodle/login/index_form.html has been removed.

How can I customize my page at https://imdcollege.edu.pk/lmstest/login/index.php to only show the "Log in with Google" button or alternatively use a custom log in page and keep this page for admin access only.

Thanks

Average of ratings: Useful (1)
In reply to Umar Farooq

Re: Custom Login Page in Moodle 3.2

by Dan Poltawski -
In reply to Dan Poltawski

Re: Custom Login Page in Moodle 3.2

by Luis Ibhiabor -

Hello Dan,

I am using the boost theme in moodle 3.2. I would also like to customize my login page. I just want to have the 'Username', 'Password', 'Login' fields and a logo (not site title) displayed on the login page.

Thanks for giving directions to the current location for the login.mustache files. However, I have a question. Are you suggesting one edits the core module? Is there an easy way to style it with css by increasing the width of the username and password fields, and hide other sections that are not required to be displayed but by not editing any core module?

Attached is a screenshot of the current login page that I would like to customize to something else please.

Thanks.

Attachment styling_login_screen.jpg
In reply to Dan Poltawski

Re: Custom Login Page in Moodle 3.2

by begum karat -

Hi,

Desperately need help. We have implemented SSO using Oauth2 and "Log in with Google" button is displayed on the index.php page and works fine. However, we only want the admin to go to the index page to login. For our users we want them to see the  "Log in with Google" button on the front page (currently shown as 'You are not logged in. (Log in)' on the upper left hand of the screenshot. 

Can someone please tell me the steps (as I'm not very familiar with the backend) so I can replace 'You are not logged in. (Log in)' with "Log in with Google" button on the front page. 

Thank you.


Frontpage



In reply to Umar Farooq

Re: Custom Login Page in Moodle 3.2

by Guillermo Dova -

To avoid editing core files nor setting up an alternate login page, I´ve been able to show only the "login in with google" button by hidding the other elements with CSS.

For example, in Boost theme, just add this to Boost theme > advanced settings > raw SCSS


form#login input#username,
form#login input#password,
form#login div.rememberpass,
form#login button#loginbtn{
    display:none
}
Average of ratings: Useful (3)
In reply to Guillermo Dova

Re: Custom Login Page in Moodle 3.2

by Ben Kahn -

Hi Guillermo,


This is interesting. I'd like to consider doing this to switch to Office 365 OIDC login at my school. Two thoughts though:

  • Is this a bit dangerous? If Google SSO went down somehow, would you be able to login with a backup manual-auth admin account?
  • DId you do any styling, like centering the elements?