0

I am building the app for android which uses single sign on in it. So for single sign on cookie is getting set to web-view. But, on single logout (SLO) SAML request and response are not getting sent. So SLO is not working.

I can see this behavior working as expected in iOS WKWebView and on the desktop browsers. But in android web view does not clear the web-view cookie which leads to failure in logout. I don't want to clear the cookie programmatically in shouldOverrideUrlLoading() as that is not a proper approach.

Is there any issue in Web-View related to SAML in android? Do I have to take care from my side? Any changes required in the server side configuration?

  • Take a look at this answer this answer [https://stackoverflow.com/a/31950789/6736510](https://stackoverflow.com/a/31950789/6736510) – Johnyoat Oct 23 '18 at 13:38
  • See this Stackoverflow thread [https://stackoverflow.com/questions/2465432/android-webview-completely-clear-the-cache](https://stackoverflow.com/questions/2465432/android-webview-completely-clear-the-cache) – K M Rejowan Ahmmed Oct 23 '18 at 13:39
  • I took this answer to clear the cookies and cache https://stackoverflow.com/questions/51167882/webview-is-not-clearing-the-cache – Gonzalo Ledezma Torres Oct 23 '18 at 13:39

2 Answers2

0

Try this,

WebView webView;
webView.clearCache(true);

Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.

https://developer.android.com/reference/android/webkit/WebView#clearCache(boolean)

JakeB
  • 2,043
  • 3
  • 12
  • 19
0

I have used the following code and got success.

 android.webkit.CookieManager.getInstance().removeAllCookies(new ValueCallback<Boolean>() {
                    @Override
                    public void onReceiveValue(Boolean value) {

                    }
                });
Rozina
  • 409
  • 3
  • 14