Users by email doesn't match with secondary account's email

Hi,

For context, in our system, some users have 1 account that login via the classic email password for APP 1 which is resticted. We also have an APP 2 where very users has a different email password which is used to authenticate. Every users in APP 1 has an account in APP 2. When a user in APP 1 is created, we link both users, APP 1 being the primary account.

I’m trying to find a user account with the secondary (APP 2 ) account’s email and the api doesn’t match it… Is there another way to search for the secondary account ? The only possible way i can think of right now is to not link accounts and deal with dual user ids in our system which is not ideal, but possible…

I’m on nodejs with the node-auth0 package.

Hi @pjcheckmain,

Welcome to the Auth0 Community Forum!

Could you expand on how you have linked user accounts and how you are looking up users?

Are you trying to do this with the built in account linking feature?

Thanks,
Dan

Yes i’m using the built in account linking mechanism.

If i look at the linked user, the 2nd account’s email is in the profileData of the item in the indentities array. So the information is there, but the api/v2/users-by-email endpoint (via the node-auth0 package) doesn’t match that email.

Maybe i could instead use the api/v2/users search instead, but the node-auth0 documentation doesn’t tell me how to send my query. (https://auth0.github.io/node-auth0/module-management.ManagementClient.html#getUsers)

If i dig a little, i think the node-auth0 package use the rest-facade package which seems to tell me to just write the query directly in the params object… Would be nice to update the doc with this information.

That definitely seems confusing. Let me try to make a request for update. I found this issue that seems to cover it and provide some examples.

https://github.com/auth0/node-auth0/issues/126

It looks like you should be able to search by identities. Let me know if you run into an issues.

Thanks,
Dan

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.