/** * On received http auth request. * The method reacts on all registered authentication tokens. There is one and only one authentication token for any host + realm combination */ @Override public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) { // Get the authentication token (if specified) AuthenticationToken token = this.getAuthenticationToken(host, realm); if (token != null) { handler.proceed(token.getUserName(), token.getPassword()); return; } // Check if there is some plugin which can resolve this auth challenge PluginManager pluginManager = this.parentEngine.pluginManager; if (pluginManager != null && pluginManager.onReceivedHttpAuthRequest(null, new CordovaHttpAuthHandler(handler), host, realm)) { parentEngine.client.clearLoadTimeoutTimer(); return; } // By default handle 401 like we'd normally do! super.onReceivedHttpAuthRequest(view, handler, host, realm); }
/** * On received client cert request. * The method forwards the request to any running plugins before using the default implementation. * * @param view * @param request */ @Override @TargetApi(21) public void onReceivedClientCertRequest (WebView view, ClientCertRequest request) { // Check if there is some plugin which can resolve this certificate request PluginManager pluginManager = this.parentEngine.pluginManager; if (pluginManager != null && pluginManager.onReceivedClientCertRequest(null, new CordovaClientCertRequest(request))) { parentEngine.client.clearLoadTimeoutTimer(); return; } // By default pass to WebViewClient super.onReceivedClientCertRequest(view, request); }
/** * On received http auth request. * The method reacts on all registered authentication tokens. There is one and only one authentication token for any host + realm combination */ @Override public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) { // Get the authentication token (if specified) AuthenticationToken token = this.getAuthenticationToken(host, realm); if (token != null) { handler.proceed(token.getUserName(), token.getPassword()); return; } // Check if there is some plugin which can resolve this auth challenge PluginManager pluginManager = this.parentEngine.pluginManager; if (pluginManager != null && pluginManager.onReceivedHttpAuthRequest(null, new X5CordovaHttpAuthHandler(handler), host, realm)) { parentEngine.client.clearLoadTimeoutTimer(); return; } // By default handle 401 like we'd normally do! super.onReceivedHttpAuthRequest(view, handler, host, realm); }
/** * On received client cert request. * The method forwards the request to any running plugins before using the default implementation. * * @param view * @param request */ @Override @TargetApi(21) public void onReceivedClientCertRequest (WebView view, ClientCertRequest request) { // Check if there is some plugin which can resolve this certificate request PluginManager pluginManager = this.parentEngine.pluginManager; if (pluginManager != null && pluginManager.onReceivedClientCertRequest(null, new X5CordovaClientCertRequest(request))) { parentEngine.client.clearLoadTimeoutTimer(); return; } // By default pass to WebViewClient super.onReceivedClientCertRequest(view, request); }