com.tencent.smtt.export.external.interfaces.HttpAuthHandler Java Examples

The following examples show how to use com.tencent.smtt.export.external.interfaces.HttpAuthHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: X5WebViewClient.java    From x5webview-cordova-plugin with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #2
Source File: X5WebViewClient.java    From cordova-plugin-x5-webview with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: X5WebViewClient.java    From cordova-plugin-x5-tbs with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #4
Source File: X5WebViewClient.java    From cordova-plugin-x5engine-webview with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #5
Source File: WrapperWebViewClient.java    From AgentWebX5 with Apache License 2.0 5 votes vote down vote up
public void onReceivedHttpAuthRequest(WebView view,
                                      HttpAuthHandler handler, String host, String realm) {
    if(mWebViewClient!=null){
        mWebViewClient.onReceivedHttpAuthRequest(view,handler,host,realm);
        return;
    }
    super.onReceivedHttpAuthRequest(view,handler,host,realm);
}
 
Example #6
Source File: BridgeWebViewClient.java    From JsBridge with MIT License 5 votes vote down vote up
@Override
public void onReceivedHttpAuthRequest(WebView webView, HttpAuthHandler httpAuthHandler, String s, String s1) {
    boolean interrupt = false;
    if (bridgeWebViewClientListener != null) {
        interrupt = bridgeWebViewClientListener.onReceivedHttpAuthRequest(webView, httpAuthHandler, s, s1);
    }
    if (!interrupt) {
        super.onReceivedHttpAuthRequest(webView, httpAuthHandler, s, s1);
    }
}
 
Example #7
Source File: X5CordovaHttpAuthHandler.java    From x5webview-cordova-plugin with Apache License 2.0 4 votes vote down vote up
public X5CordovaHttpAuthHandler(HttpAuthHandler handler) {
    this.handler = handler;
}
 
Example #8
Source File: X5CordovaHttpAuthHandler.java    From cordova-plugin-x5-webview with Apache License 2.0 4 votes vote down vote up
public X5CordovaHttpAuthHandler(HttpAuthHandler handler) {
    this.handler = handler;
}
 
Example #9
Source File: X5CordovaHttpAuthHandler.java    From cordova-plugin-x5-tbs with Apache License 2.0 4 votes vote down vote up
public X5CordovaHttpAuthHandler(HttpAuthHandler handler) {
  this.handler = handler;
}
 
Example #10
Source File: X5CordovaHttpAuthHandler.java    From cordova-plugin-x5engine-webview with Apache License 2.0 4 votes vote down vote up
public X5CordovaHttpAuthHandler(HttpAuthHandler handler) {
    this.handler = handler;
}
 
Example #11
Source File: SimpleBridgeWebViewClientListener.java    From JsBridge with MIT License 4 votes vote down vote up
@Override
public boolean onReceivedHttpAuthRequest(WebView webView, HttpAuthHandler httpAuthHandler, String s, String s1) {
    return false;
}
 
Example #12
Source File: CBrowserWindow7.java    From appcan-android with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void onReceivedHttpAuthRequest(WebView view,
                                      HttpAuthHandler handler, String host, String realm) {

    super.onReceivedHttpAuthRequest(view, handler, host, realm);
}
 
Example #13
Source File: X5WebViewClient.java    From YCWebView with Apache License 2.0 2 votes vote down vote up
/**
 * 处理HTTP认证请求,默认行为是取消请求
 * @param webView                           view
 * @param httpAuthHandler                   handler,表示一个HTTP认证请求,提供了方法操作(proceed/cancel)请求
 * @param s                                 s
 * @param s1                                s1
 */
@Override
public void onReceivedHttpAuthRequest(WebView webView, HttpAuthHandler httpAuthHandler, String s, String s1) {
    super.onReceivedHttpAuthRequest(webView, httpAuthHandler, s, s1);
}
 
Example #14
Source File: BridgeWebViewClientListener.java    From JsBridge with MIT License votes vote down vote up
boolean onReceivedHttpAuthRequest(WebView webView, HttpAuthHandler httpAuthHandler, String s, String s1);