Reputation: 309
I think the title is self explanatory. I can't find any resources or references that mention that digest authentication is supported in WebViews.
A couple of caveats:
I'm not talking about basic authentication where the authorisation header is sent with base64 encoding.
I'm only talking about WebViews embedded in an application, not simple http requests where apache http client can be used for example.
Upvotes: 2
Views: 2265
Reputation: 11
this is working for me:
webView.setHttpAuthUsernamePassword("domain", "realm", "username", "password");
webView.loadUrl("http://domain:port/url/");
Upvotes: 1
Reputation: 125
In one word, it does support HTTP digest authentication. I have tested and sure about it.
Upvotes: 0
Reputation: 6697
You can set one WebViewClient in your WebView and override below method in your WebViewClient, see below code..
private class ExWebChromeClient extends WebViewClient {
@Override
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
super.onReceivedHttpAuthRequest(view, handler, host, realm); //To change body of overridden methods use File | Settings | File Templates.
}
}
webView.setWebViewClient(new ExWebChromeClient());//set your Extended WebViewClient here
Here you can show one auth dialog..See showHttpAuthentication method from Android native Browser app here, here one http auth dialog is shown and handled properly inside WebView
Upvotes: 1
Reputation: 2007
Use the setHttpAuthUsernamePassword method of the WebView
to specify the username and password to use. It's used for basic and digest authentication requests.
Upvotes: 0