Hi,

I'm trying (desperately) to view a protected url in a WebView
instance. I can view the url just fine using curl:

  curl -u username:password http://somesite.com/somefolder

I'm trying the same with a WebView:

  WebView wv = ...;
  wv.setHttpAuthUsernamePassword("somesite.com", "", "username",
"password");
  wv.loadUrl("http://somesite.com/somefolder";);

but this does not work, I always get an empty output from that url
(because I haven't authenticated I suppose). I get the same output as
if I were to use curl without specifying username/password, or if I
had just copied the plain url into a web browser.

I also tried to supply a WebViewClient and override
onReceivedHttpAuthRequest(), but it doesn't even get called:

  class AWebViewClient extends WebViewClient {
        @Override
        public void onReceivedHttpAuthRequest(WebView view,
HttpAuthHandler handler, String host, String realm) {
            Log.e(TAG, "This is never called.....");
        }
  }

anyone have any idea what I can do here? Since curl is working, I'm
sure it must be possible to get this to work?

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to