Django-keycloak refresh openID connect .well-known error

Hello everyone i really need help in a issue i faced while working on django-keyclock:

you can see here the documentation that I’m following: Welcome to Django Keycloak’s documentation! — Django Keycloak 0.1.2-dev documentation

I did the initial setup and I setup for remote user , then i configured the server and the realms in the django admin panel and everything looks good. but when i try to Refresh OpenID Connect .well-known I got this error in the image.

And i think that /auth is the problem because when I remove it I got a json response.

please if anyone can help me. and thank you in advance.

In older versions of Keycloak, there used to be auth/ as the first segment of the path. That’s now optional. Given that django-keycloak package you are using hasn’t been updated in a while, my guess is that it’s making an assumption about the paths that is no longer necessarily true.

You could either hunt through the codebase for that, or use the mozilla python OIDC library, which is more mature, recently updated, and has current tutorials for use with recent versions of Keycloak

1 Like

Thank you so much for your reply.
Yes I tried a lot of ways to change that url but nothing is working I also searched in the django-keycloak files but i couldn’t find anything.
I’m trying to follow this repo but I think I will face the same problem because it was created in 2019.

So i will take your advice can you please tell me which one i should use in those documentations:
https://mozilla-django oidc.readthedocs.io/en/stable/installation.html
GitHub - Amsterdam/keycloak_oidc: A simple Django app to use Keycloak over OIDC
And sorry I’m really a beginner with keycloak and security configuration.

1 Like

Both are fairly good examples. I don’t have a recommendation for which to try first.

1 Like

Thank you so much for your help, I appreciate that.

Hi @soso,

Have you successfully implemented it? If yes, can I get the work way out for it? I am also working on it and blocked at this moment.