Hi guys, I have an issue to login to a website with a simple form login.
My code always returns website login page despite the fact that all the parameters are correct and I'm trying to access to a home page. I'm using the classic AuthScope.ANY method.
thanks for your help. Please don't pay attention to the url mistake and correct it easily if you wan't to give a try...
But when I go to that site it looks like it uses form-based authentication. That isn't supported by the authentication protocols in HttpClient. You're going to have to pass suitable parameters (i.e. whatever parameters the form asks for) in your POST request.
well...... now I'm a bit embarassed cause I didn't read that httpclient did not handle this auth method... then that's really true that the website uses a post method so I just need to use something like :
HttpClient client = new HttpClient();
That's sending the parameter name UserID, but no value, nor the password. You should send it as "UserID=xxx&password=yyy". But if you use HttpClient, you can use PostMethod and its addParameter methods.