django-keycloak
django-keycloak copied to clipboard
Set username as Keycloak Username (instead of Keycloak ID)
This is what my keycloak User Screen looks like

BUT when I log within django,
- user.email is proper (whats present in keycloak)
- user.username is getting set as ID from keycloak.
Is there a way to retain djnago username as keycloak username?
I am getting django_keycloak.auth.bacjends dose not have define a BaseKeycloakMiddleware attribute/class
Hi nirav, if you could start a different issue/thread with your configuration files, then i could see how i could help
On Mon, 30 Mar, 2020, 12:00 Nirav Kakkad, [email protected] wrote:
Hi Shrikant, I am trying to use django_keycloak but I am not able to authenticate the users. I followed the tutorial till initial setup, can you please help me with the initial setup of the project
Hi Shrinath, I am trying to use django_keycloak but I am not able to authenticate the users. I followed the tutorial till initial setup, can you please help me with the initial setup of the project Hi nirav,
I would not be ready to mix up others issues within this issue post, if you could start a different issue/thread with your configuration files, then i could see how i could help
Why does the plugin not use preferred_username that is being returned by Keycloak?

I get user id of the authenticated keycloak user in Django instead of username when I use request.user.username
Does preferred username give us the username of the user specified in keycloak of that user?
I get user id of the authenticated keycloak user in Django instead of username when I use request.user.username
Does preferred username give us the username of the user specified in keycloak of that user?
prefered_username of oauth does return username, but this plugin does not seem to be reading it
Why does the plugin not use
preferred_usernamethat is being returned by Keycloak?
Update:
I locally changed it to preferred_username and did python3 setup.py install and logged in. Things seems to work fine and keycloak Username is getting populated to user.username
Still awaiting more testing, but basic run looks good