I am trying to use Java to download a file from a form-based authentication sharepoint(as a .NET web application, but all requests are redirected to the login.aspx page. The following are the steps I use:
- Get the file url, and it will be redirected to login page.
- get all parameters from the page content;
- post to login.aspx page with the parameters and account & password;
- Then Get the file and write it into a file;
The steps 3 & 4 are redirected to the login.aspx page. Maybe the 3rd step failed?
PS,
- java tool: apache HttpClient 4.1.2
- Java Code:https://www.drivehq.com/folder/p9066489.aspx
- Log:https://www.drivehq.com/folder/p9066503.aspx