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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Login via HTTP-Connect...
Power Automate
Unanswered

Login via HTTP-Connector fails

(0) ShareShare
ReportReport
Posted on by

I want to automatically download a file (that's behind a login) every hour and then process it further. I can't seem to get the login right.

 

First I do a GET with one HTML Connector on this URL: https://b2b.cube.eu/Account/Login?ReturnUrl=%2fMyCube%2fV2%2fBackorder%2fIndex%2f0%3fart%3d1%26OnlyPromptly%3dfalse%26OnlyReady%3dfalse%26sstr%3d%26IDLfrAdr%3d%26ipp%3d150%26sort%3d0%26desc%3dfalse%26save%3dtrue&art=1&OnlyPromptly=false&OnlyReady=false&sstr=&IDLfrAdr=&ipp=150&sort=0&desc=false&save=true

The one GET-parameter ReturnUrl is the file I want to download, but since I have to follow the 302 manually, I'm not sure whether it is actually useful to leave it in. Anyway, shouldn't affect the outcome.

 

Reponse:

 

 

"statusCode": 200,
"headers": {
 "Pragma": "no-cache",
 "X-AspNetMvc-Version": "5.2",
 "X-Frame-Options": "SAMEORIGIN",
 "Request-Context": "appId=cid-v1:d9a0c4f9-bc3e-46e0-a60f-f9e6681fb42d",
 "Access-Control-Expose-Headers": "Request-Context",
 "Vary": "Accept-Encoding",
 "Cache-Control": "no-store, must-revalidate, no-cache",
 "Date": "Wed, 03 Mar 2021 13:13:36 GMT",
 "Set-Cookie": "ASP.NET_SessionId=ml25uyoj3h1lfdpxu53mypsn; path=/; HttpOnly; SameSite=Lax,HASH_ASP.NET_SessionId=65B2250EBD1A7ECD809FEC49F4B48D3216766ADB; path=/; HttpOnly; HASH_SameSite=410086B490421B753EFDE3A7215CB6A147EC12F2,ASP.NET_SessionId=ml25uyoj3h1lfdpxu53mypsn; path=/; HttpOnly; SameSite=Lax,HASH_ASP.NET_SessionId=65B2250EBD1A7ECD809FEC49F4B48D3216766ADB; path=/; HttpOnly; HASH_SameSite=410086B490421B753EFDE3A7215CB6A147EC12F2,__RequestVerificationToken=0VqHtmj2isIrwtKtkX-yxpeKVcRS2ceRwhrhJsArv2Q6MvVZ0V50KkxOzqSoGF_dMv4IilMqeC4QEjT84iQJJZAlcCeyTuWLd_W02f8YwKY1; path=/; HttpOnly,HASH___RequestVerificationToken=4C3686E3543D8BE985C864AEA254D423CF09EB8B; path=/; HttpOnly",
 "Server": "Apache",
 "X-AspNet-Version": "4.0.30319",
 "X-Powered-By": "ASP.NET",
 "Keep-Alive": "timeout=15, max=100",
 "Connection": "Keep-Alive",
 "Transfer-Encoding": "chunked",
 "Content-Type": "text/html; charset=utf-8",
 "Expires": "-1",
 "Content-Length": "15079"
}

 

 

 

This is the form in the HTML body of the response (I've deleted some parts that are just for optics):

 

 

<form action="/Account/Login?ReturnUrl=%2FMyCube%2FV2%2FBackorder%2FIndex%2F0%3Fart%3D1%26OnlyPromptly%3Dfalse%26OnlyReady%3Dfalse%26sstr%3D%26IDLfrAdr%3D%26ipp%3D150%26sort%3D0%26desc%3Dfalse%26save%3Dtrue" method="post">
 <input name="__RequestVerificationToken" type="hidden" value="k878Z-rJBi6rYnvy9RLTPEd5SVEJbqgykKRk9ppcaNnNIUZXWQ8LBYRRZJBZHtHyzd5zdAPP4ZnQ6OvAicogvYEBlGmSqOcNYwHtboylyww1" />
 <input name="LogOn.UserName" type="text" value="" />
 <input name="LogOn.Password" type="password" /> 
 <button type="submit">Anmelden</button>
</form>

 

 

 

I then extract the the hidden input in the form and feed them into a second HTTP Connector, that does a POST on the same URL with this body:

 

 

__RequestVerificationToken=k878Z-rJBi6rYnvy9RLTPEd5SVEJbqgykKRk9ppcaNnNIUZXWQ8LBYRRZJBZHtHyzd5zdAPP4ZnQ6OvAicogvYEBlGmSqOcNYwHtboylyww1&LogOn.UserName=myuser&LogOn.Password=mypass

 

 

And as headers I just set "Cookie" to the extract string I get in "Set-Cookie" from the first HTTP Connector. The RequestVerificationTokens in the hidden input and in the cookie are different, but that's also the case when I login with Chrome and look at it with Developer Tools.

 

Instead of a 302 to the URL I put in the ReturnURL GET-parameter, I get a 200 and the login website telling me that the login failed. What am I doing wrong?

 

Help would be much appreciated.

Categories:
I have the same question (0)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 274 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 175

#3
Haque Profile Picture

Haque 166

Last 30 days Overall leaderboard