cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
svp95bos
Level: Powered On

How to get Access token via HTTP action in Flow

I'm trying to authenticate against an App Service that I have defined in Azure Active Directory. When accessing it, I first get the access token and the continue with the rest of the OAuth procedure.

The problem, however, is that I can only get the token when posting the request via Postman. When I try to call the same URL, with the same data using an HTTP action in flow, it fails:

 

{
  "error": "invalid_client",
  "error_description": "AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 67250fbf-ad20-47f1-b3a3-dbce1e813600\r\nCorrelation ID: f9eaaa13-cee3-4f5c-a96a-6846c4392dd9\r\nTimestamp: 2018-01-17 12:21:51Z",
  "error_codes": [
    70002,
    50012
  ],
  "timestamp": "2018-01-17 12:21:51Z",
  "trace_id": "67250fbf-ad20-47f1-b3a3-dbce1e813600",
  "correlation_id": "f9eaaa13-cee3-4f5c-a96a-6846c4392dd9"
}

This is how it is set up in Flow:

 

WCjfx

 

When executed in Postman it works just fine:

 

wx6SF

I cannot figure out why this doesn't work when running the request from within a Flow. Am I missing something in the HTTP action card configuration?

Kind regards, Peter

2 ACCEPTED SOLUTIONS

Accepted Solutions
svp95bos
Level: Powered On

Re: How to get Access token via HTTP action in Flow

I found the reason for this not working. I had to fully URL encode the value for client_secret.

 

/Peter

Parmi
Level: Powered On

Re: How to get Access token via HTTP action in Flow

5 REPLIES 5
svp95bos
Level: Powered On

Re: How to get Access token via HTTP action in Flow

I found the reason for this not working. I had to fully URL encode the value for client_secret.

 

/Peter

Parmi
Level: Powered On

Re: How to get Access token via HTTP action in Flow

I am getting same error, but could not understand your resolution. could you please help in 'fully URL encode the client secret'. how do i do that or a screenshot of your working flow action

abd3127
Level 8

Re: How to get Access token via HTTP action in Flow

@svp95bos@Parmi

i am getting the same error.

Can u explain how u solved it?

 

Parmi
Level: Powered On

Re: How to get Access token via HTTP action in Flow

DLGross
Level 8

Re: How to get Access token via HTTP action in Flow

Thanks, this solved my problem with the missleading error message i was getting from the Client Secret value

Dean Gross

Office 365- MSCA
SharePoint - MCSE
Microsoft 365 Enterprise Administrator Expert

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 429 members 5,855 guests
Please welcome our newest community members: