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

Keycloak database entries on first load (OIDC_RESOLVE_USER_FUNCTION) #34

Open
reinoudbaker opened this issue Aug 13, 2019 · 0 comments
Open

Comments

@reinoudbaker
Copy link

This bug appears on the initial load of a user (i.e. when the models.KeyCloak is not yet persisted to db) . When firing two simulatious request on function backend.get_user_by_id can raise an IntegrityError exception (duplicate key in models.KeyCloak) on line 157 of bossoidc.backend

suggested fix:
change
kc_user = KeycloakModel.objects.create(user = user, UID = uid)
to:
kc_user, created = KeycloakModel.objects.get_or_create(user = user, UID = uid)

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

1 participant