Hi, I am looking for an API to get a UserID from a...
# talk-kratos
d
Hi, I am looking for an API to get a UserID from a credential. I looked around and couldn't find anything. Am I missing something ?
p
Hi @dazzling-vase-23428 could you elaborate? the
sessions/whoami
endpoint returns the full user identity (id incl) when the user has a session.
d
In this specific instance, I am looking to use Kratos as a "database" of users. So I have no user session active.
@proud-plumber-24205?
p
Hi @dazzling-vase-23428 not sure what your requirements are, could you elaborate?
d
To keep it short, I need to access traits (in this case the groups the user is member of) of an Identity without It being connected. I could try to keep the ID, but it would be more user friendly not to and just keep the credential.
p
Alright so at which point in the process do you check this? It seems the user doesn't sign in yet, but rather you get some sort of credential (password?) from the user and then try extract the userID from kratos through that?
d
Oh, I meant identifier, not credential 🤦
Sorry about that
p
So you want to reverse search the identity ID through the identifier (email, username etc.)?
d
Yes
p
We don't support reverse searching the identifier like that https://github.com/ory/kratos/issues/249
An alternative is to map this on your side with a webhook after registration
d
Thank you,