web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get Access toke...
Power Automate
Unanswered

How to get Access token via HTTP action in Flow

(2) ShareShare
ReportReport
Posted on by 37

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

Categories:
I have the same question (0)
  • Verified answer
    svp95bos Profile Picture
    37 on at

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

     

    /Peter

  • Community Power Platform Member Profile Picture
    on at

    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 Profile Picture
    320 on at

    @svp95bos@Anonymous

    i am getting the same error.

    Can u explain how u solved it?

     

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi,

     

    Please read this article https://sharepointmadeeasy.blogspot.de/2018/02/microsoft-flow-http-rest-api-invalid.html

     

    hope it helps.

     

     

  • Dean Gross Profile Picture
    242 on at

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

  • KarthikKota Profile Picture
    Microsoft Employee on at

    Great, thank you.

  • rehanmemon Profile Picture
    on at

    Please go through the Blog explaining the process to Generate Access Token in Power Automate

     

     

  • Kankamon02 Profile Picture
    15 on at

    This Article is very helpful Generate Access Token in Power Automate

    I solved my issue because of this article

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard