Peter Rundqvist
Peter Rundqvist

Reputation: 315

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:

enter image description here

When executed in Postman it works just fine:

enter image description here

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

Upvotes: 0

Views: 3088

Answers (1)

Peter Rundqvist
Peter Rundqvist

Reputation: 315

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

/Peter

Upvotes: 1

Related Questions