Calling Cloud API Returns Invalid Client Using Client Credentials

Calling Cloud API returns Invalid Client using Client credentials

Issue Description

Calling Cloud API returns Invalid Client using Client Credentials

{
"error": "invalid_client"
}



Diagnosing/Resolving

  1. This error occurs in three scenarios:

    1. The client ID is incorrect

    2. The client secret is incorrect

    3. The App Registration does not have application scoped permissions or is not a confidential app.

  2. To resolve this do the following:

    1. Go to the app registration in Orchestrator and verify the Client ID. Take a screenshot in case a ticket is needed. See Managing External Applications for how to get the application registrations.

    2. Regenerate the secret. See Generating A New App Secret documentation. After regenerating the secret, try the API call using the new secret.

    3. Verify the application has Application Scope permissions.

      1. Go to the App Registration per Managing External Applications

      2. Find the App Registration and select Edit.

      3. The Application Scope should be confidential and have application scopes defined.

image.png

  1. If the above does not help with the issue, provide the following to UiPath Support:

    1. Screenshots of the application ID.

    2. Screenshots of the application registration.

    3. Information on how the API call is being made. For example, if using powershell, include the relevant powershell code. If using Postman, include the postman configuration (screenshots should be enough)

      1. For Postman, a HAR trace can be gathered using the following steps: How To Get Logs From The Postman Desktop App?

        • A HAR trace of the issue should be enough for UiPath.

      2. If using a custom application that runs locally on the testing machine, try getting a fiddler trace. Go through step 4-7 of this KB article : How To Use Fiddler As A Proxy For The Robot Service To Collect Information ?

        • After completing these steps, just restart the application being debugged.

        • Typically applications automatically pick up fiddler settings and it should be possible to see the network traffic from the application after this point.