1

I am trying to develop a small android app for my organization's ticket handling website which is a secured site https. I have created my own customized httpclient and my own SSLSocketFactory.

String user_Name = "asia\\manoharamkem";
String pass_Word = "Temenos13";
List<NameValuePair> nvps = new ArrayList<NameValuePair>(2);
nvps.add(new BasicNameValuePair("username", user_Name));
nvps.add(new BasicNameValuePair("password", pass_Word));          
HttpResponse response = httpclient.execute(httpost);
Log.w("TCSPP","RESPONSE CODE : "+response.getStatusLine().getStatusCode());

When I execute the above code, the code is always displayed as 200 even with incorrect login credentials. I cannot share my url as it is confidential.

I am not sure whether the code 200 is for login or for url access is successful. I am googling for the past 1 week and no clue. Please help me in logging to a https website.

My company's website is like this https://myurl.com and on launching the same, it will be redirected to the url https://myurl.com/CookieAuth.dll?GetLogon?curl=Z2F&reason=0&formdir=5 which displays the login page. I have to login into this url through android app.

Please help me on this.

Regards, Manohar

sabadow
  • 5,095
  • 3
  • 34
  • 51
  • I think you should try to rule out, that this isn't the webserver returning this statuscode by accident. Try running the login in a non-Android HTTP client. Also: if you want us to research the issue it would be very comprehensive if you added the custom implementation of the Android HttpClient to your question. – Darwind Oct 14 '13 at 11:07

2 Answers2

0

response code 200 represent that The request has succeeded. to check the login condition you need to verify it on server side and want to return the result as success or error.

Dinesh Raj
  • 664
  • 12
  • 30
0

If you get a 302 redirect as a response, you need to switch of redirect. This can be done as described here: https://stackoverflow.com/a/1519487/1892046 .

Community
  • 1
  • 1
Bas
  • 881
  • 1
  • 10
  • 23