Seaching from among users assigned to an app

Pulling the appId from AD-sourced integration ( I am querying Okta), I am trying to search within that collection of users (i.e., those assigned to that particular app) for a particular user with a specific last name. In other words, I want to return all users whose last name is Stone that is part of the appId I have set in my global variable. Here is the query I have developed,

{{url}}/api/v1/apps/{{appId}}/users?search=profile.lastName eq “Stone”

The problem is that it retrieves users who have “Stone” in the managerDn. I don’t want this, I want only users whose last name is “Stone”. How do I revise my query to accomplish that?

@jbogdan Welcome to the Community :partying_face:

I haven’t used Okta APIs before, but I did a little research and you are right. I see the same format in the documentation.

Also I don’t see the key name “managerDn”, it that based on the customization?

I don’t see any issue in the endpoint of yours.

But can you just try filter option?

{{url}}/api/v1/apps/{{appId}}/users?filter=profile.lastName eq “Stone”

Let’s see how this behaves :blush:

1 Like

It spits out an error,
“errorCode”: “E0000005”,
“errorSummary”: “Invalid session”,

Oh :roll_eyes: so this invalid session is something to do with the Authentication?

1 Like

I don’t think the authentication is invalid. Using the same environment variables, I can query the Okta tenant just fine with other queries. As such, I think the above query is malformed.

@jbogdan Oops, is that so?

Filter is also a valid option provided in their documentation. So that should work as well. And the endpoint is a bit different here, so I believe you have some customizations for internal usage?

Because I tried to import the OKTA collections into my workspace and I see the below for search operation.

So there’s no issue with the resource and params. Just confirm the endpoint URL once. May be we connect through call if needed :blush:

Any possibility to check with your developers?

This is my LinkedIn profile :slightly_smiling_face:

What you’re missing is that I am taking the users assigned to an app and then searching among those for a particular last name. Your query searches for all users in an Okta tenant for a particular department.

For example, here is a valid query for all the users assigned to a particular app (if you place the id into the appId environment variable).
{{url}}/api/v1/apps/{{appId}}/users

I wish to then search from that set of users for one with a matching lastName.

Does anyone have input on how this can be solved?