Integrate Keycloak and Django for Authentication and Authorization

1,131 views
Skip to first unread message

Ricardo Fernandez

unread,
Jul 28, 2022, 5:51:00 PM7/28/22
to Keycloak User
Hello 
I hope you are fine.

I'm just starting with Keycloak and Django and can't find any connector or updated libraries for integrating these two tools.
I'm using Keycloak 13.x and Django 4.x

There was a django-keycloak project, but  apparently is not maintained anymore, and not working with newer versions of Django, and also the documentation is scarce.  
I haven`t found any other libraries or connectors or examples to perform a similar task in a simple fashion.
There seem to be a lot of tools for Java, but for Python/Django almost nothing.

Any help on this subject will be much appreciated!!
Warm regards
Ricardo

Garth

unread,
Jul 28, 2022, 7:42:35 PM7/28/22
to keyclo...@googlegroups.com
I don't know your full requirements, but I've had success with the Django OpenID Connect library from Mozilla https://github.com/mozilla/mozilla-django-oidc
> --
> You received this message because you are subscribed to the Google
> Groups "Keycloak User" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to keycloak-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/keycloak-user/522b53fb-d3ce-4d95-b3f3-08b83f78e2d0n%40googlegroups.com
> <https://groups.google.com/d/msgid/keycloak-user/522b53fb-d3ce-4d95-b3f3-08b83f78e2d0n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ricardo Fernandez

unread,
Jul 29, 2022, 6:54:44 AM7/29/22
to Keycloak User
Hi Garth,
Thank you very much for your answer!
Were you able to authenticate and also handle authorization? (permissions to access different parts of your application) 
Because from what I read, mozilla-django only handles authorization, that is who you are but not what permissions you have. (I might be wrong but that is what I found)

Thank you!!

Garth

unread,
Jul 29, 2022, 8:21:25 AM7/29/22
to keyclo...@googlegroups.com

Ricardo Fernandez

unread,
Jul 29, 2022, 8:32:15 AM7/29/22
to Keycloak User
Well, that could be a very good starting point.
Would you mind sharing the configuration with which you achieved success using this library? (except of course for any sensitive information you used) so I can have a starting point to work on my own configuration with the Mozilla library? (settings.py, urls.py, view.py, etc.)
You can send it directly to my email in case you don't want to show them in this public thread. Whatever you decide to do would be fine for me.

Thank you very much!!
Best regards
Ricardo

Reply all
Reply to author
Forward
0 new messages