I’m importing apps and their OAuth scope grants from Okta. Calling GET /api/v1/apps/{appId}/grants for some apps returns 404, so I’d like to skip apps that don’t support grants without missing any that do.
An Okta Developer Forum reply suggested filtering with /api/v1/apps?q=oidc_client. That avoids the 404s I saw, but it also excludes some apps with signOnMode: "OPENID_CONNECT" whose grants endpoint returns 200—for example, the Okta Admin Console app.
What field or filter should I use to identify all apps that may have grants? Is signOnMode == "OPENID_CONNECT" sufficient, including OAuth 2.0 service apps, or are there exceptions or other app types I should include?
Hi @ashoksingh,
The cleanest way to identify applications that support the /grants endpoint without programmatically probing every single app (which can trigger rate limits) is to use Okta’s new App Search endpoint, which is currently in Early Access.
You can perform a single GET request filtering specifically for OIDC and API Service (machine-to-machine) apps, as these are the types that support scope grants:
http GET /api/v1/apps/search?types=OIDC,API_SERVICE
In my testing, this query matched the supported apps exactly, every app returned by this query supported the /api/v1/apps/{appId}/grants endpoint, and no supported apps were left out.
To use this endpoint, you will need to enable the “Applications page enhancements” feature flag in your Okta Admin Console under Settings → Features. (Note: This will change how your admin portal’s Applications page looks).
Here is our documentation where you can learn more: List all applications that match search filters
I hope this helps! Let me know if you run into any issues.