I want to use the client_credentials flow to obtain a server side access token that can be used for fetching the user profiles of all users in the Okta instance.
I created an OAuth Service app, granted the okta.users.read scope for the app and then tried to use the client credentials flow:
curl --request POST --url https://.okta.com/oauth2/default/v1/token --header ‘accept: application/json’ --header ‘Authorization: Basic …’ --header ‘cache-control: no-cache’ --header ‘content-type: application/x-www-form-urlencoded’ --data ‘grant_type=client_credentials&scope=okta.users.read’ -v
This returns an error response:
{“error”:“access_denied”,“error_description”:“The requested feature is not enabled in this environment.”}
Why does this error occur? Does the “API Access Management” feature need to be enabled in order to use the client credentials flow?