I have a sharepoint site, which has ntlm authentication. in order for me to load the page, i do an authentication to the site using this.
public String LoadUrlWithNTLM(String url){
CkHttp http = new CkHttp();
http.put_Login("username");
http.put_Password("password");
http.put_NtlmAuth(true);
http.put_SessionLogFilename("ntlmAuthLog.txt");
String source = http.quickGetStr(url);
return source;
}
and load the webview with this.
public void LoadWebView(String url, String source){
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadDataWithBaseURL(url, source, "text/html", "", "");
}
i call this in the OnCreate()
source= LoadUrlWithNTLM(url);
LoadWebView(url,source);
then i check if there is a url event click with this
webView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url){
String toWebView = LoadUrlWithNTLM(url);
LoadWebView(url,source);
return false;
}
});
at some point, i can manage through go to the Sharepoint Site with NTLM Authentication, but when i click some link, it just display "401 UNAUTHORIZED" and do not invoke the shouldOverrideUrlLoading() method on breakpoint.