X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/b124167f50c69bb98c1456f48ec9fcfab4bd63c1..54dc3efc18d67028e1691fee2309431daa2afab3:/src/com/owncloud/android/authentication/SsoWebViewClient.java diff --git a/src/com/owncloud/android/authentication/SsoWebViewClient.java b/src/com/owncloud/android/authentication/SsoWebViewClient.java index 27e1f5b8..60178a81 100644 --- a/src/com/owncloud/android/authentication/SsoWebViewClient.java +++ b/src/com/owncloud/android/authentication/SsoWebViewClient.java @@ -25,7 +25,7 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import com.owncloud.android.lib.common.network.NetworkUtils; -import com.owncloud.android.utils.Log_OC; +import com.owncloud.android.lib.common.utils.Log_OC; import android.content.Context; import android.graphics.Bitmap; @@ -66,6 +66,7 @@ public class SsoWebViewClient extends WebViewClient { private WeakReference mListenerRef; private String mTargetUrl; private String mLastReloadedUrlAtError; + public SsoWebViewClient (Context context, Handler listenerHandler, SsoWebViewClientListener listener) { mContext = context; @@ -86,6 +87,7 @@ public class SsoWebViewClient extends WebViewClient { @Override public void onPageStarted (WebView view, String url, Bitmap favicon) { Log_OC.d(TAG, "onPageStarted : " + url); + view.clearCache(true); super.onPageStarted(view, url, favicon); } @@ -118,11 +120,11 @@ public class SsoWebViewClient extends WebViewClient { public void onPageFinished (WebView view, String url) { Log_OC.d(TAG, "onPageFinished : " + url); mLastReloadedUrlAtError = null; + CookieManager cookieManager = CookieManager.getInstance(); + final String cookies = cookieManager.getCookie(url); + Log_OC.d(TAG, "Cookies: " + cookies); if (url.startsWith(mTargetUrl)) { view.setVisibility(View.GONE); - CookieManager cookieManager = CookieManager.getInstance(); - final String cookies = cookieManager.getCookie(url); - Log_OC.d(TAG, "Cookies: " + cookies); if (mListenerHandler != null && mListenerRef != null) { // this is good idea because onPageFinished is not running in the UI thread mListenerHandler.post(new Runnable() { @@ -195,6 +197,8 @@ public class SsoWebViewClient extends WebViewClient { @Override public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host, String realm) { Log_OC.d(TAG, "onReceivedHttpAuthRequest : " + host); + + ((AuthenticatorActivity)mContext).createAuthenticationDialog(view, handler); } @Override @@ -229,5 +233,4 @@ public class SsoWebViewClient extends WebViewClient { Log_OC.d(TAG, "shouldOverrideKeyEvent : " + event); return false; } - }