Skip to content

Remove keycloak id from user model#629

Open
thescouser89 wants to merge 1 commit intoproject-ncl:masterfrom
thescouser89:quarkus-drop-user-id
Open

Remove keycloak id from user model#629
thescouser89 wants to merge 1 commit intoproject-ncl:masterfrom
thescouser89:quarkus-drop-user-id

Conversation

@thescouser89
Copy link
Contributor

The keycloak id is present in the user model to guarantee uniqueness. However, it is also pretty much guaranteed that the username will uniquely identify a single user only.

The other reason why this commit removes the keycloak id is because we need to support other ways of authentication (LDAP). LDAP doesn't provide such a keycloak id (but in theory we could use a unique ID from the LDAP entry for the user). However the same user authenticating through LDAP and then through OIDC would be considered 2 different 'persons' because of the different ids.

I believe it would be much easier to just use the username to uniquely identify a user as a result.

Checklist:

  • Have you added unit tests for your change?

@thescouser89 thescouser89 requested a review from rnc March 25, 2026 19:25
The keycloak id is present in the user model to guarantee uniqueness. However, it is also pretty much guaranteed that the username will uniquely identify a single user only.

The other reason why this commit removes the keycloak id is because we need to support other ways of authentication (LDAP). LDAP doesn't provide such a keycloak id (but in theory we could use a unique ID from the LDAP entry for the user). However the same user authenticating through LDAP and then through OIDC would be considered 2 different 'persons' because of the different ids.

I believe it would be much easier to just use the username to uniquely identify a user as a result.
@thescouser89 thescouser89 force-pushed the quarkus-drop-user-id branch from ee40d52 to cab5932 Compare March 25, 2026 19:45
Copy link
Contributor

@rnc rnc left a comment

Choose a reason for hiding this comment

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

Looks fine to me - one question - would this cause any issues with existing tables?

@thescouser89
Copy link
Contributor Author

@rnc I think it'll cause issues for the existing NotNull annotation that might set that constraint at the db level. We'll have to remove it post-deployment.

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

Successfully merging this pull request may close these issues.

2 participants