Error at login with Keycloak third-party authentication

Hello :wave:

I’m currently trying to implement third-party authentication using Keycloak, I’ve activated the keycloak OAuth2 backend provided by python-social-auth using a yml plugin, I’m able to select my OAuth Provider in the login page and then provide my credentials in the keycloak form.

Then when the authentication is completed I’m redirected to the edX login page with the following error message

An error occurred when signing you in to My Open edx.
We are sorry, you are not authorized to access My Open edx via this channel. Please contact your learning administrator or manager in order to access My Open edx.

Error Details:
Authentication failed: HTTPConnectionPool(host=‘localhost’, port=8080): Max retries exceeded with url: /auth/realms/ippon/protocol/openid-connect/token (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f8817920e50>: Failed to establish a new connection: [Errno 111] Connection refused’))

On the keycloak side, the logs say the login is successful. It seems like Open edX or Tutor is blocking something :confused:

What am I missing ? I’ve followed this doc (integrating third-party auth to edx) and this doc (python-social-auth keycloak implementation instructions) to integrate my keycloak identity provider.

Thank for your help ! :slight_smile:

I halve solved this error, the keycloak is on a docker container and wasn’t in the same network as tutor.

However I’ve now a new error

Any idea ?