cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelixRech
Frequent Visitor

Using 'HTTP Request' activity to get OAuth token

Hey Community, 

 

I'm trying to us the 'HTTP Request' Activity to get a OAuth token from the endpoint https://cloud.uipath.com/identity_/connect/token.

The body for the POST request has been tested in other environments and works just fine there, but when im using PA im getting the error "Invalid Client". My best guess is, that the error is related to the syntax and I'm hoping that one of you can help me out.

 

Screenshot 2021-06-10 153341.png

1 ACCEPTED SOLUTION

Accepted Solutions

I found the solution to my problem with a bit of luck and trial and error. This is how the body should look like: Screenshot 2021-06-10 175047.png

View solution in original post

3 REPLIES 3
Gopala_Krishna
Super User
Super User

@FelixRech 

I tried checking the documentation related to the UIPath API and here's something that I found which might be useful for you.

Using OAuth for External Apps (uipath.com)

 

As per the above documentation it seems that you are missing the code:"Authorization code" in the body. The sample body for the post request to the end point https://{Orchestrator_URL}/identity/connect/token looks as below

{ grant_type: "authorization_code" code: "{authorization_code}" redirect_uri: "{redirect_url}" client_id: "{app_id}" client_secret: "{app_secret}" }

 

The body that you have used is for another end point https://{Orchestrator_URL}/identity/connect/authorize which is a identity server authorization endpoint, please try to go through the documentation for more information.

 

-------------------------------------------------------------------------------------------------------------------------------------

If the information shared helps, please consider giving a thumbs up 👍 and mark solution as resolved

 

FelixRech
Frequent Visitor

Hello @Gopala_Krishna

 

thank you for the kind answer. I'm familiar with this documentation of course. I think your not looking at the correct documentation yet. Since I'm trying to connect to the could orchestrator, I'm refering to this documentation: https://docs.uipath.com/automation-cloud/docs/setting-up-the-external-application

 

I'm using this body because I've set Power Automate as an confidential application in an application Scope (second option in the first table)

 

FelixRech_0-1623335238710.png

Following the link, I'm forwarded to this part of the documentation:

FelixRech_1-1623336019430.png

 

As mentioned in the original post, this combination of endpoint and parameters works just fine when executing it in python for example.

 

Kind regards 

 

I found the solution to my problem with a bit of luck and trial and error. This is how the body should look like: Screenshot 2021-06-10 175047.png

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,553)