I have a Javascript app that is utilizing the Auth0 library. I have logged in one user with Twitter and two with LinkedIn and one with Auth0 for a total of 4 user records. I have a user login with LinkedIn and then we get a response back from the callback that looks like this:
Object {
"family_name": "Smith",
"given_name": "John",
"name": "John Smith",
"nickname": "john.a.smith",
"picture": "https://media.licdn.com/dms/image/C4E03AQG-Cn-ouWQlpQ/profile-displayphoto-shrink_100_100/0?e=1537401600&v=beta&t=gIg442j35l2A6gdatgi_B523r3hJFFQ5KjbuZDZtqU",
"sub": "linkedin|QJn-UJxjUx",
"updated_at": "2018-07-17T07:27:13.041Z",
}
I want to then retrieve the details of that account so I use the management API to make a search query. My query looks like this:
const userSearchResponse = await fetch(`${privateKeys.auth0.domain}/api/v2/users`, {
method: 'GET',
headers: {
qs: { q: 'identities.user_id.raw:"QJn-UJxjUx"', search_engine: 'v2' },
authorization: `Bearer ${privateKeys.auth0.managementToken}`
}
});
const userSearchParsed = await userSearchResponse.json();
this.extractLinkedInData(userSearchParsed);
However, when I make this search query it returns all 4 records every time. I have tried changing the q param to be
'nickname:"john.a.smith"''
'nickname.raw:"john.a.smith"''
And none of these work. I’m getting every record back (from Twitter, Auth0, and LinkedIn). Has anyone had any success using the search query with JS? Thanks in advance!