okta-sdk-nodejs icon indicating copy to clipboard operation
okta-sdk-nodejs copied to clipboard

check if a group exist using "filter" not "q"

Open fas3r opened this issue 5 years ago • 3 comments

Hello,

Is there a way to check that a group exist using "filter" instead of "q" with listGroups() based on the "profile name " ?

I tried profile.name but it returns an error.

Thanks.

fas3r avatar Mar 02 '19 16:03 fas3r

The docs only indicate filtering on the following properties:

  • type
  • lastUpdated
  • lastMembershipUpdated
  • id

Filtering by name isn't supported or isn't doc'd. It's not clear why q is insufficient for you, but I imagine you want to combine it with other filters. If so, you can always do two queries: one to get the id, and another to filter with the id.

kevlened avatar Mar 04 '19 18:03 kevlened

Hello,

The problem with q is that it return all the groups starting with the name that you want to lookup/find

Example you query my.group.1 and you have my.group.1, my.group.11, my.group.111 , it will return all of them, not the exact match, or I missed something.

Thanks

fas3r avatar Mar 05 '19 05:03 fas3r

I would love to figure out a way to fetch a group by it's profile name also. I have the same problem as you where I get multiple results when use "q=GroupName" since a number of our groups are often prefixed the same. We currently are stuck with fetching the entire group list (over 6mb) and then parsing that for an exact match (not efficient at all).

brettpappas avatar May 02 '19 20:05 brettpappas