Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set username as Keycloak Username (instead of Keycloak ID) #39

Open
srinathganesh1 opened this issue Mar 29, 2020 · 7 comments
Open

Set username as Keycloak Username (instead of Keycloak ID) #39

srinathganesh1 opened this issue Mar 29, 2020 · 7 comments

Comments

@srinathganesh1
Copy link

srinathganesh1 commented Mar 29, 2020

This is what my keycloak User Screen looks like
Screenshot from 2020-03-29 22-25-10

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?

@srinathganesh1 srinathganesh1 changed the title Within User set username as email address User set username as Keycloak Username (instead of Keycloak ID) Mar 29, 2020
@srinathganesh1 srinathganesh1 changed the title User set username as Keycloak Username (instead of Keycloak ID) Set username as Keycloak Username (instead of Keycloak ID) Mar 29, 2020
@nirav3650
Copy link

I am getting django_keycloak.auth.bacjends dose not have define a BaseKeycloakMiddleware attribute/class

@srinathganesh1
Copy link
Author

srinathganesh1 commented Mar 30, 2020 via email

@srinathganesh1
Copy link
Author

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

@srinathganesh1
Copy link
Author

Why does the plugin not use preferred_username that is being returned by Keycloak?

Screenshot from 2020-04-02 01-53-34

@nirav3650
Copy link

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?

@srinathganesh1
Copy link
Author

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

@srinathganesh1
Copy link
Author

Why does the plugin not use preferred_username that is being returned by Keycloak?

Screenshot from 2020-04-02 01-53-34

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants