Repository navigation
Replies: 1 comment
|
Keycloak's Admin REST API won't let you set the user's ID, it will generate a GUID itself (and will do it for a reason). Keycloak relies on the internal user ID being unique per server. So the only way to keep the IDs is to perform a direct database migration. I highly recommend not doing that. You might be fine if you have only one realm with legacy (sequential) IDs, but with more realms you can easily get ID conflicts. I would recommend to let Keycloak manage the IDs, and store legacy IDs in the user's attributes. But, judging on your next questions, that's exactly what you've already tried :) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I have a database with several million users, where the userIds are sequential integers starting from 1 and incrementing. All requests in my websites are currently based on these userIds.
Now, I want to migrate these users to a Keycloak database, but I’m encountering a major issue: Keycloak assigns UUIDs to users as their userId, which means the existing userIds in my database would change after migration.
My question is:
If I configure the userIds in Keycloak to remain as sequential integers (as they are in my current system) instead of UUIDs, will this cause any issues in Keycloak’s functionality? For example, could it cause problems with web services or other internal processes in Keycloak?
Additionally, what is the best practice for handling such a scenario where the existing userIds need to be preserved during migration?
I appreciate any guidance or recommendations.
Thank you!
keycloak version : 26.0.1
All reactions