Hi All, I have 2 users with the same email address...
# talk-kratos
l
Hi All, I have 2 users with the same email address but different metadata values. From what I understood from the docs, only one user can exist for a certain email/username. Is there any other way to have this multi attribute identifier use case implemented? Thanks!
m
Hello @limited-ocean-65577 can you elaborate a bit more on the details. Why are there 2 identities with the same identifier in your system?
l
Hi Vincent, Sure, I want to have an environment (env) separation here. Eg: user@example.com can exist as a dev env user and a prod env user (both). So I was planning to have the env as a metadata. When the user is authenticating, I should be able to retrieve the user from a combination of the email and the env metadata. Hope that explains it.
m
Yes that makes perfect sense. There are probably multiple ways to solve it, but I think the easiest would be to create another Ory project/deploy another Kratos, so one for dev and one for prod. Do prod and dev use the same domain? Or is it more an authorization thing maybe? prod and env have access to different parts of your system, as opposed to being completely different “people”/identities.
l
Yep they do share the same domain. Its like having test users for the dev environment for development purposes and consumers in the prod environment who actually use the application. I think I can move ahead with deploying another Kratos. Found this on a forum and "Scenario 1" is a usable approach.
Thanks for your help!
m
Hey @limited-ocean-65577 gotcha! I think Scenario 1 is the most reasonable as well (and the “simplest” too!) Can I ask where you found this? very interesting 🙂
l
Of course. I agree. I found it here: https://github.com/ory/kratos/discussions/3039