[Webkit-unassigned] [Bug 118849] [Curl] Http response code 401 (Authentication required) is not handled.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jan 14 11:49:30 PST 2014
https://bugs.webkit.org/show_bug.cgi?id=118849
--- Comment #13 from peavo at outlook.com 2014-01-14 11:47:08 PST ---
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > In this patch,when given username and password was wrong,Will webkit or curl resend the request?
> > > And Does WebCore resend the request ? or client? or Curl automatic?
> >
> > When given username or password is incorrect, I believe we will receive another 401 response, and give the user another chance to provide credentials.
> > If new credentials are provided, we will give the user/password to curl by calling curl_easy_setopt(curlHandle, CURLOPT_USERPWD, usernameAndPassword).
> > AFAIK this will make curl resend the request automatically.
>
> Thanks for your replay.
> I had met some problems.My browser is developed on WinCE SYS。
> I had patched the webcore part of this patch to my browser and code FrameLoaderClientWinCE::dispatchDidReceiveAuthenticationChallenge() as follow:
> void FrameLoaderClientWinCE::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge& challenge)
> {
> String user;
> String pwd;
> if (m_webView->requestAuthentication(challenge,user,pwd) == 0)
> {
> Credential credential(user,pwd,CredentialPersistenceNone);
> challenge.authenticationClient()->receivedCredential(challenge,credential);
> return;
> }
>
> challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);
> }
>
> In WebView::requestAuthentication(),I will give user a dialog to input username and password.
>
I think this code looks fine.
> In expect,when visit a website with basic authentication,browser should given user a dialog to input username and password.if username and password is correct,the page will dispaly.if username and password is incorrect,browser should given user a dialog again until user inputs a right username and password or cancel the visit.
>
> In actually,on my browser,if user's first input is correct,the request page will be dispalyed. but if the first input is incorrect,whaterver the second input is ,401 error page will be displayed and there is not dialog yet.
>
I guess the behaviour also depends on how many times the server will send back a 401 response, before it sends an error page. Have you tried other sites? How does other browsers behave on your test site?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list