Hide Moodle Default Login Page and use OAuth2 Authentication only

Hide Moodle Default Login Page and use OAuth2 Authentication only

by Eva Cheong -
Number of replies: 10

I have configured the authentication with OAuth 2 service and it does appear on the Moodle Login page, but now I would like to have only OAuth2 authentication and redirect back to Moodle site. May I know how should I proceed? I have tried to make changes to the login page and directly redirect to OAuth2 authentication page with redirect() function, but after I pressed on the Login button it kept redirecting me to OAuth issuer site and then Moodle oauth2callback.php as shown in the screenshot below. or is there any available plugin for the implementation?

browser network tab redirect loop

Average of ratings: -
In reply to Eva Cheong

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by JIMMY LARRAIN -

Hi,

I had the same problem and i resolved changing CSS additional in my theme, here my example :

form.login-form { visibility: hidden;     height: 0; }


I hope help you, good luck!


Jimmy from peru

In reply to JIMMY LARRAIN

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by Ken Task -
Picture of Particularly helpful Moodlers

Pardon interruption ... @Jimmy .... a question ... if the Oauth2 Authentication breaks ... and that coiuld happen ... how does one login as admin to the moodle?

Curious mind ... smile

'SoS', Ken

In reply to Ken Task

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by JIMMY LARRAIN -
Remember that this is an artifice from the browser (web client); if a problem occurs with OAUTH2 you can always disable these attributes in the browser, and login with manual method
Average of ratings: Useful (1)
In reply to JIMMY LARRAIN

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by Albert T -
Can you clarify? How does making the form invisible make it work? Thanks
In reply to Albert T

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by JIMMY LARRAIN -

This is original Login (theme Boost)


Settings advanced in Boost Theme


This is the result


In reply to JIMMY LARRAIN

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by Albert T -
Thank you Jimmy. I can see that this works, but the user would have still to click the "Correo educativo" button. Still better than what I have
In reply to JIMMY LARRAIN

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by Shufeng Bai -
I can't get this working. I never modified CSS before. I copy pasted your code to my boost theme advanced settings but see no effect in the login page. Do you know what might be wrong? I am using 3.11.3+
Thanks
In reply to Shufeng Bai

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by JIMMY LARRAIN -
This code works with "Academy" Theme, because the Tags used exists in this CSS theme. Boost use other CSS file.

Jimmy
In reply to JIMMY LARRAIN

Re: Hide Moodle Default Login Page and use OAuth2 Authentication only

by Shufeng Bai -

Thanks for pointing that our. Do you know how I can make it work for boost? I know very little CSS.