Saksham
(Saksham Rastogi)
November 5, 2021, 7:20am
1
Hi All,
Is anyone able to use the Orchestrator API OAuth2.0 for authorization, getting token and starting a job in orchestrator via NodeJs?
I did try and followed the documentation but I am getting an error
Node.js code
External Application
Error
If anyone has been able to successfully integrate it, please let me know
1 Like
Hello @Saksham ,
are you sure that “client_id” = App ID from the application? Why are you using “client_credentials” authentication type?
Best,
Artur
Maybe it’s because of the code? Isn’t it passing parameters as the request headers? They should be included in the request body, as you see here:
Saksham
(Saksham Rastogi)
November 5, 2021, 8:35am
4
Hi Artur,
The reason I am using the client credentials auth type is because if I choose the authorisation code type , it would require a manual intervention (this is what I have observed when I used postman where as soon as I request a new token, i need to first login to the automation cloud account first)
I am pretty new to this and looking for ways to do so.
Something must be wrong with the request - it’s not correctly taking the data.
Hi I am facing the same issue, has anyone found a solution for this?
Check these screenshots:
Configure the External Application
In Postman the URL will be https://cloud.uipath.com/identity_/connect/token
with the method POST
In Headers specify Content-Type: application/x-www-form-urlencoded
Example:
In the Body select x-www-form-urlencoded
This is a back-end example for the HTTP Request:
POST /identity_/connect/token HTTP/1.1
Host: cloud.uipath.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=YOUR_CLIENT_ID&scope=OR.Administration%20OR.Analytics%20OR.Assets%20OR.Audit%20OR.BackgroundTasks%20OR.Execution%20OR.Folders%20OR.Hypervisor%20OR.Jobs%20OR.License%20OR.Machines%20OR.ML%20OR.Monitoring%20OR.Queues%20OR.Robots%20OR.Settings%20OR.Tasks%20OR.TestDataQueues%20OR.TestSets%20OR.Users%20OR.Webhooks&client_secret=YOUR_CLIENT_SECRET
Let us know if this approach worked for you in Postman at least.