OAuth2 integration with Keycloak

OAuth2 integration with Keycloak

by Francesco Sabiu -
Number of replies: 1

Hello,

I am using Moodle 3.6 and I am trying to enable the Oauth2 authentication via Keycloak. I'm using the latter as a portal to distribute the logins and passwords. 

Although I have inserted the keycloak base URL in the Service base URL field, once I click on the external login button, the system redirects the user to the /moodle/auth/oauth2 folder, as illustrated in the attached screen capture.


Do you have any suggestions?

Thanks


Attachment oauth2.png
Average of ratings: -
In reply to Francesco Sabiu

Re: OAuth2 integration with Keycloak

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

If you've set the Service base URL and this happens then presumably the OAuth 2 issuer, i.e. Keycloak, doesn't support endpoint discovery. In which case you'll need to configure the endpoints manually, this post includes information on this.