Hey,
I am trying to search users via a linked account’s email, and tried the following query, not getting anything back:
https://[mytenant].auth0.com/api/v2/users?q=identities.profileData.email:mail@blahblah.com&search_engine=v3
However, it worked if I search via primary account’s email, but that’s not what I am looking for, I am hoping there’s a way to search user via non-primary account email.
Not very pretty, but I suppose one way to handle this is to update the primary user’s user_metadata with some linked_accounts data and then query on the user_metadata.
A valid use case for sure. Just for info, in our app, we don’t want the ‘secondary’ email to become available again.
Since linking accounts deletes the secondary account, basically that email is available for sign up again and a basic users by email search doesn’t find the linked email.
Is there a reason that the second account must be deleted?
Terribly sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes our bandwidth is just not enough for all the questions that are coming in. Sorry for the inconvenience!
EDIT: Perhaps at the time this question was asked the search wasn’t working for the email which isn’t the primary in the linked account but I have just tested this and it appears to be working now.
@MattLiu it is possible to find the user from the linked accounts email address using identities.profileData.email query parameter. You may find different samples for queries on this link..
Here is a sample for searching test@test.com in the linked identity:
@a2345sooted this also seems to be fixed. For a linked account , when I try to signup with an email which exists as a secondary identity for another user on the same connection, signup is failing with an error that the user email exists.