hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Bezdek <bezd...@yahoo.com>
Subject Re: Detecting Whether Authentication Was Successful
Date Mon, 05 Mar 2007 23:20:15 GMT
Well, for one thing, there are 3 sites that I want to login, and I can easily do it on all
3 sites using their login form and Post method.  So, I have no problem authenticating on all
3 sites.  However, there must be some common way of knowing that you've been logged in without
having to do something site specific (for example, I can go through the response body and
find a string that indicates that I have been authenticated.  However, then I have to customize
the solution for each site and I don't see this being a good solution).

Also, it seems that I can't depend on the response code. For example on many sites, even if
I fail the authentication, they still send me a 200 response code.  If the  authentication
fails, shouldn't the site give me a response that indicated the authentication has failed?
 By the way, I don't have any control over those sites that I am trying to authenticate to;
so, I can't change the behavior of the server.


sebb <sebbaz@gmail.com> wrote: This totally depends on how the site is coded.

One approach is to try and access a page that is protected by the
login and see what happens.

But again, how you detect whether access has been granted depends on
how the site is coded.

Try with a browser an see what happens.

On 05/03/07, Dan Bezdek  wrote:
> Hi Everyone,
> I am new to HttpClient, and I can't find any source on the proper way of authenticating
when I am trying to login to a site that has a login form.
> Basically, I can login using post method, but I can't find any source that tells me what
response code should be returned in order for me to be sure that the authentication has succeeded.
 I don't really care what the server does after authentication (for exampale if I get redirected
or not), all I want to know is that I am logged in.  Someone suggested that the standard way
is to use the Head method first to make sure authentication would succeed.  In any case, could
someone please tell me what the common way of doing the authentication is?  I don't need details,
just a step-by-step outline of what to do and what response code I should expect.
> I really appreciate your help.
> Thanks,
> Dan Bezdek
> ---------------------------------
> Never miss an email again!
> Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.

To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message