cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelixRech
Helper I
Helper I

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
Solution Sage
Solution Sage

@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
Helper I
Helper I

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,011)