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

Gracefully report duplicate usernames #3481

Merged
merged 2 commits into from
Jul 10, 2023

Conversation

dbutenhof
Copy link
Member

@dbutenhof dbutenhof commented Jul 6, 2023

PBENCH-1198

With the move from a private Keycloak ID provider to Red Hat SSO, we find that several user UUID values (from the old and new ID provider) are attempting to claim the same username. The current user "cache" doesn't allow for this, nor in general does it seem we really want to be casually mapping multiple "users" across ID providers into the same "Pbench identity" just because they share a username.

Instead, diagnose this problem with an authorization failure and an explicit error message instead of letting the Auth module hide the error and silently treat the client connection as unauthenticated.

Note that we can manually fix this by renaming the old user entry in SQL, which will allow the server to recognize the new SSO login. We can then reassign any existing datasets from the old user to the new user.

@dbutenhof dbutenhof added bug Server API Of and relating to application programming interfaces to services and functions Users Of and relating to working with users. labels Jul 6, 2023
@dbutenhof dbutenhof self-assigned this Jul 6, 2023
ndokos
ndokos previously approved these changes Jul 6, 2023
webbnh
webbnh previously approved these changes Jul 7, 2023
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, assuming the answer to my question is no big deal....

lib/pbench/test/unit/server/auth/test_auth.py Outdated Show resolved Hide resolved
dbutenhof added 2 commits July 9, 2023 09:06
PBENCH-1198

With the move from a private Keycloak ID provider to Red Hat SSO, we find that
several user UUID values (from the old and new ID provider) are attempting to
claim the same username. The current user "cache" doesn't allow for this, nor
in general does it seem we really want to be casually mapping multiple "users"
across ID providers into the same "Pbench identity" just because they share a
username.

Instead, diagnose this problem with an authorization failure and an explicit
error message instead of letting the Auth module hide the error and silently
treat the client connection as unauthenticated.

Note that we can manually fix this by manually renaming the old user entry in
SQL, which will allow the server to recognize the new SSO login. We can then
reassign any existing datasets from the old user to the new user.
@dbutenhof dbutenhof dismissed stale reviews from webbnh and ndokos via 6d57c4f July 9, 2023 13:06
@dbutenhof dbutenhof requested review from ndokos and webbnh July 9, 2023 13:07
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dbutenhof dbutenhof merged commit 1361bcc into distributed-system-analysis:main Jul 10, 2023
@dbutenhof dbutenhof deleted the dupuser branch July 10, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Of and relating to application programming interfaces to services and functions bug Server Users Of and relating to working with users.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants