General developer forum

Custom Login 3.4

 
Picture of begum karat
Re: Custom Login 3.4
 

Hi Dorel, thank you for responding. However, that is not what I am trying to do. I'm probably not very clear. I need to have the "Log in with Google' button on the front page and upon clicking the button the users gets authenticated with their Google credentials. 




We have successfully implemented SSO with Oauth2 and it is currently working on login/index.php and what we really want to do is to have the Google button (only) available on the front page instead of redirecting the users to /login/index.php



 
Average of ratings: -
Picture of Jun Pataleta
Re: Custom Login 3.4
Core developersMoodle HQPlugin developersTesters

Hi Begum,

I would probably create an alternate login page which only renders the Google authentication button and set the URL to this page as the value of the "Alternate login URL" ($CFG->alternateloginurl) setting in the "Common settings" section of the "Site administration / Plugins / Authentication / Manage authentication" administration page.

I think this would be the simplest solution to your needs.

Hope this helps.

 
Average of ratings: -
Picture of Jun Pataleta
Re: Custom Login 3.4
Core developersMoodle HQPlugin developersTesters

As proof of concept, please check out this gist

Hope this helps.

P.S. Since this approach of using an alternate login URL overrides the original login form and disables manual login, please keep in mind that your admin account should be able to log into the site via the Google OAuth service as well. Otherwise, you might get locked out of the site.

 
Average of ratings: -