<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z0000745EY2CAMOkta Identity EngineAPI Access ManagementAnswered2021-07-16T15:16:29.000Z2021-07-13T14:13:24.000Z2021-07-16T15:16:29.000Z

Tanuja.25041 (Customer) asked a question.

Unable to get response of OKTA's ListUsers with Search API via okta-sdk-nodejs Client's listUsers method

Code snippet:

async getUsersByEmail(value) {

try {

return await Promise.all([

oktaClient.listUsers({

search: value,

}),

]).then((values) => {

console.log(values);

});

} catch (e) {

throw Error('Cannot get the users: ' + e);

}

}

Response:

[

Collection {

nextUri: "http://test-admin.okta.com/api/v1/users?search=profile.email%20eq%20'test%40gmail.com'%20",

client: Client {

requestExecutor: [DefaultRequestExecutor],

authorizationMode: 'SSWS',

baseUrl: 'http://test-admin.okta.com',

apiToken: 'dhdkjaskjassad',

http: [Http]

},

factory: ModelFactory { Ctor: [class User extends Resource] },

currentItems: [],

request: undefined

}

]

I am unable to get response array while trying to use already available okta-sdk-nodejs's listUsers method. Though, I am getting correct response with same request parameters while trying to run with Postman.

 

OKTA API Doc Link: https://developer.okta.com/docs/reference/api/users/*list-users-with-search

 

OKTA SDK node.js Link: https://github.com/okta/okta-sdk-nodejs*get-a-user (Go to Search for Users section)

 

I am using the following method ->

client.listUsers({

search: 'profile.email eq "test@gmail.com"'

}).each(user => {

console.log('User matches search:', user);

});

 

Kindly help!


  • User15840148818329692410 (Vendor Management)

    Hi,

    This is George from Okta Support

    Please open a support ticket with SDK's and Libraries Product selected and one of our Support Engineers will help you investigate this issue.

     

    Thank you

    Expand Post
This question is closed.
Loading
Unable to get response of OKTA's ListUsers with Search API via okta-sdk-nodejs Client's listUsers method