I'm currently working on migrating an ASP.NET Web Forms website to have an API so that it can have a React front end.
I'm going to continue to use forms authentication to begin with for this migration, but would like to know how to POST on the login form (/login.aspx) from Postman so that forms authentication works and logs me in so I can then proceed to test the APIs I write. I'm using the standard ASP.NET web forms login control.
I've tried using this (https://www.youtube.com/watch?v=B4ilccLUQVs) method, which seems to at least get me the POST data I need I suppose, but there seems to be something missing as I'm being redirected to login.aspx in Postman and any calls to the API still ask for authentication.
I did notice it invokes some javascript method called WebForm_DoPostBackWithOptions in the onclick event handler when the login button is pressed, but I'm not sure how I'd invoke this in Postman.
If anyone's done this already, I'd be glad to heard from you!
You need Postman Interceptor and Interceptor Bridge to capture the forms authentication cookies to authenticate your Postman POST/GET requests. You would also use Interceptor to capture and save your Google Chrome browser API requests in a Postman Collection.
Copy and Paste steps from Postman Community: Source
Requirements
Quick Start
Run the install script from the OS-specific Interceptor Bridge package. Do not change the location of the com.postman.postmanapp.json file after executing the install script. Depending on your OS, you might need to double-click or execute the installer script via a shell. Users on MacOS/Windows might see a security warning. For example, to override the security on MacOS, you may need to right click > open.
Restart Chrome (only required for Windows)
Update the Postman Interceptor Extension to v0.2.26 or above (chrome://extensions/ > enable Developer Mode > Update).
Update Postman to v7.2.1 or above.
Open the capture cookie overlay from the icon on the top-right.

The ‘Interceptor Connected’ status indicates that Postman is able to communicate with the Interceptor extension installed in the browser.
Enable the Capture cookies setting, and add domains you want to sync cookies for.
Additional: source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With