Users search with linked account's email

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.

thanks!

1 Like

I ran into this also.

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.

Hey,

Thanks for the feedback on our Search v3 functionality! I will bring up to the Engineering team in charge. It seems like a very valid use case to me.

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?

Hey there!

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!

Do you still require further assistance from us?

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:

curl -H "Authorization: Bearer MNG-API-TOKEN" https://tenant_name.[region].auth0.com/api/v2/users?q=identities.profileData.email%3A%22test%40test.com%22&search_engine=v3 

@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.

1 Like

Thanks for sharing that with the rest of community @Saltuk!