Unable to call system logs api without a role assigned to the system app

Hello,

I have a backend service which needs to fetch logs from Okta system/logs api.
To be able to do that I have implemented OAuth with Okta with a Service app by following this document Implement OAuth for Okta with a service app | Okta Developer.

I am am getting an access token using Client Credentials grant flow with the OAuth service app.
The problem which I am facing is I am getting a 403 if I don’t assign “Report Administrator” to the service app.

Is it mandatory to assign the admin role to call system logs api using this approach ? Is there any alternative where I don’t have to assign any role. ?

Yes, this is required with the roll out of the feature to assign admin roles to applications, as described in our guide here:

Before Okta provided the ability to assign admin roles to service apps, the Super Administrator (SUPER_ADMIN) role was automatically assigned to all service apps. You can now fine-tune the resources that a service app can access by assigning specific standard or custom admin roles. No role is automatically assigned, so you must assign a role before you use the service app. If you have a Production org and want to turn on the Assign admin roles to public client apps feature, see Manage Early Access and Beta features (opens new window).

You should be using this functionality to down-scope the access this client application has to the least privilege needed. For example, if you want to enable the okta.users.read scope, you can use the admin roles to ensure that your service app is only able to read a certain subset of users (for example, users in a specific group).

Thank. you for the valuable information. This answers my question.

I just have 2 follow up questions, if you could help me on those as well.

  1. How to create a least privilege needed for calling GET system logs api ? which I can assign it to the Service App.
  2. Can I get a link to the release note of this feature, so that I can include it in the design.

Thanks,
Manoj

Following up on the above answer on assigning admin roles to the Service App.

I just have 2 follow up questions:

  1. How to create a least privilege needed for calling GET system logs api ? which I can assign it to the Service App.
  2. Can I get a link to the release note of this feature, so that I can include it in the design.

Thanks,
Manoj

You could look to create a custom admin role and only grant it read access to System logs.

As this is not yet GA in production, the release notes for this are pretty limited. These are the docs that discuss the change however:
Assign admin roles to the OAuth 2.0 service app | Okta Developer
Assign admin roles to apps | Okta Help Center