[Webkit-unassigned] [Bug 118849] [Curl] Http response code 401 (Authentication required) is not handled.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 5 19:11:55 PST 2014


--- Comment #12 from await_me <jy_lizl at cn.fujitsu.com>  2014-01-05 19:09:41 PST ---
(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);


In WebView::requestAuthentication(),I will give user a dialog to input username and password.

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.

When degbugging in curl,I find "hand->state.authproblem" has been set to "true" when user inputs wrong usename and password. Then request will be ended with 401 error.
I don't  know why it does not work well as expectation.Does this patch could implement the expectation as above?

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