4 ms·
Are you asking if you can use Keycloak with your own user table? Typically these identity providers want to own the user, so would expect you to port the user i
by mooreds 5y ago
Are you asking if you can use Keycloak with your own user table? Typically these identity providers want to own the user, so would expect you to port the user info, including password hashes, into them.
If you have data that is user related but not auth related (application specific data), I've seen a few patterns:
* Push it all into the auth provider. Not sure about keycloak, but some providers have the ability to store arbitrary data (a blob, basically) about a user.
* Create a table in your database with an identifier provided by Keycloak, preferably an immutable one. Then when a user logs in, you can find their identifier, then look up the application specific data.
If you want to have all PII in one place, the former option is best. If you want to maximize your flexibility, the latter is what I'd suggest.
If you want to keep the user data in your database, I'd look at a library (as you suggest). It's a different class of solution than a standalone auth provider like Keycloak.
- vosper 5y ago> Are you asking if you can use Keycloak with your own user table? Yes, that's what I'm asking. Because my User table has relationships with the rest of my database, and I want to keep that (user X owns application-item Y; User X created Comment Z on application-item Y, etc... you get it). > Create a table in your database with an identifier provided by Keycloak, preferably an immutable one. Then when a user logs in, you can find their identifier, then look up the application specific data. This looks like a good option to me. I'd be fine with PII in Keycloak, and app-specific stuff in my database, provided there's a solid link between the two. If the user wants to change their email, that goes into Keyclock, and if they do something else that is connected to the application function that goes into the app DB. Thanks!
- mooreds 5y agoAwesome. And I mistyped. When I said: > Create a table in your database with an identifier provided by Keycloak, preferably an immutable one. I really meant: Create a column in a table in your database with an identifier provided by Keycloak. Preferably an immutable identifer from Keycloak. So you could just add 'keycloak_id' into your normal users table and then you can pull any keycloak managed data back using an API.