Calling Apps API from browser


So I’m building a React app and I have a use case where I need to fetch all the available Groups related to an OKTA app.
Use case: we’ll use the groups as roles and an Admin will be able to set a group as the owner of a resource or set a role as having certain permissions to read/write a resource.
I would prefer not to use a static groups list and be able to fetch them on app initialization.

I’m making the request to fetch app groups from the browser and getting CORS errors.
I’ve gone through the documentation, and I see that for the Apps API is not possible to enable CORS.
Is there any other way of getting a list of groups for an app from the browser?

Thank you very much!!

@garzito Hi can I ask what the API you used and what is the doc you followed? Is there a link?

I’m calling the API at /api/v1/apps/{{applicationId}}/groups?expand=group
The docs I followed are here:
Under “List groups assigned to application”

Thank you for your help!!

Did you ever check this article?
You may need to call list groups from server side or backend.

Right, I figured. Okay, I’ll do that then.
Thank you @Lijia !

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.