Problem statement
A tenant administrator would like to obtain an access token for use with the Management API Explorer. For details of this process, refer to Get Access Tokens Manually. Note that this requires the use of an M2M application, which uses Client Credentials Flow.
However, any attempt to navigate to the Test or API Explorer page will result in an error that indicates that it has not been possible to obtain an access token for use with the Management API.
Explain the reason(s) why this error condition might be experienced.
Symptoms
An error is encountered when using the Client Credentials Flow, such as when accessing the Management API Explorer page.
Troubleshooting
The most likely source of error relates to Hooks or Actions that modify the Client Credentials Flow.
Cause
Client credential Hooks/Actions will run for all client credential flows. Conditional logic needs to be implemented within the code for Hooks / Actions to take these types of requirements into consideration.
Solution
Check the extensibility code relating to Hooks or Actions. If necessary, add additional console.log statements to determine the source of the error. For more information, refer to Explore Flows and Triggers
NOTE: Hooks are in the process of being deprecated. For more information, refer to the Changelog entry Rules and Hooks are Removed from All New Tenants. Customers are recommended to move their extensibility code to Actions, as discussed in this Migration Guide