OAuth login button not showing

OAuth login button not showing

by Jeremy Steinberg -
Number of replies: 13
I have setup OAuth for Microsoft as per the guide (https://docs.moodle.org/311/en/OAuth_2_Microsoft_service). However after completing the process there is no option showing to login via this method. The only difference is that the guide says there is a "show on login page." On Moodle 4.04 there is no such option. It is a fresh install. Running on Ubuntu 20.04 on nginx as a docker volume.
Attachment Picture2.jpg
Attachment Picture3.jpg
Average of ratings: -
In reply to Jeremy Steinberg

Re: OAuth login button not showing

by Jeremy Steinberg -
Figured it out. The guide is missing the following steps
1. Go to Site administration -> Plugins
2. Click on Manage authentication
3. In the table "Available authentication plugins" look for OAuth 2 and click the enable button so that the eye icon isn't greyed out
In reply to Jeremy Steinberg

Απάντ: Re: OAuth login button not showing

by Takis Paras -
Hello are u still available for a quick help? I got the same issue with you trying to connect a keycloak with the moodle but it keep saying me that the login is not configured and also i cant see the option for the show at the login page

In reply to Takis Paras

Re: Απάντ: Re: OAuth login button not showing

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

The Not configured warning triangle suggests you haven't added the endpoints needed for login.

You must also have enabled OAuth 2 on the Manage Authentication page.

In reply to Leon Stringer

Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Takis Paras -
yes thanks a lot for your answer i tried to manage it out and now the login is with a green tick and i can see the login button. But one more issue now the moodle must be https? Because i try to connect to get authorized by keycloak , my keycloak is running https while my moodle is running http and when i click to login it navigates me to a keycloak path that it says not found invalid url
In reply to Takis Paras

Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

when i click to login it navigates me to a keycloak path that it says not found invalid url

A URL on the Keycloak server? Is it one of the endpoints you've set in Moodle for this service? In which case surely one of the endpoints is wrong.

Based on this Stack Overflow answer the endpoints are:

  • authorization_endpoint: …/auth/realms/<your_realm>/protocol/openid-connect/auth
  • token_endpoint: …/auth/realms/<your_realm>/protocol/openid-connect/token
  • userinfo_endpoint: …/auth/realms/<your_realm>/protocol/openid-connect/userinfo

The endpoints you've entered for Keycloak in Moodle can be tried in your browser. You should see an access denied message (because you're not providing the required parameters) but you should not see a 404 Not Found page. If you do then that endpoint URL is wrong.

If you're still having problems maybe a screenshot will help us understand the problem.

Average of ratings: Useful (1)
In reply to Takis Paras

Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Have you set up the client on your Keycloak server?
In reply to Emma Richardson

Απάντ: Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Takis Paras -
tnx a lot all of you for your answers they helped me a lot and finnaly figured it out how to do it . I got green tick at login, the keycloak login is showing well. Last issue if someone willing to help is when i logout it send me to keycloak , I press logout and after this it sends me to a keycloak default confirmation page. Can I change this and redirect back to my moodle page when I press the Logout button?
In reply to Takis Paras

Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I am just working on figuring this out too - I think it has to be a Keycloak setting...let me know if you find the answer and I will let you know if I find it!
In reply to Emma Richardson

Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Takis Paras -
thanks a lot yes i will let you know!! as i saw the problem is the default theme probably thats what im working on too
In reply to Takis Paras

Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I use Foundation which allows you to send the logout to Keycloak instead of just logging out of Moodle which I have set up but I don't like that they are then stuck on the Keycloak page and i would prefer they were sent back to Moodle - but that is definitely a keycloak setting - I just haven't quite figured out the exact way to do that.
In reply to Emma Richardson

Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Takis Paras -
Yes I do the same thing but when it redirect me to keycloak question to logout and press the button it then redirect me to a keycloak default logout confirmation page thats were I wanna redirect back to moodle login page
In reply to Takis Paras

Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Yes, that is what I want too - I have been trying to add a redirect_uri to the logout link but haven't managed to make it work yet...
Average of ratings: Useful (1)
In reply to Emma Richardson

Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: Απάντ: Re: OAuth login button not showing

by Takis Paras -
Hello again did u manage to find any solution? I searched internet over and over and didn't manage to find something out. I also used redirect urls but nothing happened!