Resolve error "AADSTS50012: Invalid client secret is provided" in MS Flow's HTTP connector

I need to use HTTP connector in Microsoft Flow work flow to get the access token from SharePoint Online.

I followed the article "Access SharePoint Online using Postman" to register the app and get the client id, client secret and tenant id. I composed the "body" section and added headers key to "HTTP" connector, and then submit the work flow by adding a new file to document library. However, it was failure with error "AADSTS50012: Invalid client secret is provided".

Finally, I found out the issue is related to the none encode string of client secret value, and so I use "Variable" connector to save the client secret and other values, and used function "encodeUriComponent(...)" to encode the client secret value. The issue was gone and the HTTP call was successful to get the access token. The configuration of HTTP connector is as below screen shot.







In this course you will learn how to create and manage Flow from desktop, laptop, or mobile devices and connect with multiple services such as SharePoint, Twitter, Facebook, and other networking sites.

Instructor: William Klein - Microsoft Certified Trainer William is a Microsoft Certified Trainer (MCT) with extensive skills in ASP.NET, Silverlight, SQL Server, Microsoft Dynamics CRM, performance and load testing.

Comments

  1. instead of multiple variables, this will help too. please read the article.
    http://sharepointmadeeasy.blogspot.de/#!/2018/02/microsoft-flow-http-rest-api-invalid.html

    ReplyDelete
  2. Thanks a lot. I am struck with this error for more than an hour.

    ReplyDelete
  3. In simplest of terms, offshore hosting is a hosting which you get in the country or the continent which is far away from your own country.

    ReplyDelete

  4. We Providing Mulesoft Training Courses In Hyderabad Ameerpet.Mulesoft
    Training In Hyderabad. Mule ESB Training In Ameerpet Hyderabad.100% Job Oriented
    Certifications Assistance.Placement Guaranteed Mulesoft Training Courses in Hyderabad

    ReplyDelete

  5. We are providing best software institute in Hyderabad and best online training
    in Hyderabad and all IT courses in Hyderabad.Expert trainers in JSV IT SOLUTIONS

    ReplyDelete

Post a Comment

Popular posts from this blog

Top JavaScript courses helping you develop SPFx webPart with ReactJS and AngularJS

Effective LLM Prompting skills

Enable the Microsoft Power BI report file type (.pbix) in SharePoint Search