android webview with https connection and basic auth. How to get this working?

后端 未结 3 1872
面向向阳花
面向向阳花 2021-02-02 14:31

I have researched and researched and researched this until I\'ve gone grey and bald. How on earth do I get a webview to work for a site that needs http basic authentication over

3条回答
  •  爱一瞬间的悲伤
    2021-02-02 15:10

    for handling authorization on your site, just override the following method in your webViewClient and add username and password in its handler.

    @Override
            public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
                handler.proceed(StringUtils.AUTH_NAME,StringUtils.AUTH_PASS);
            }
    

提交回复
热议问题