Java 类org.apache.cordova.AuthenticationToken 实例源码

项目:ShaPaoZi-Mobile    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:COB    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:COB    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:cordova-vuetify    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:cordova-vuetify    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:x5webview-cordova-plugin    文件:X5WebViewClient.java   
/**
 * 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);
}
项目:x5webview-cordova-plugin    文件:X5WebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:cordova-plugin-x5-webview    文件:X5WebViewClient.java   
/**
 * 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);
}
项目:cordova-plugin-x5-webview    文件:X5WebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:keemob    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:keemob    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:keemob    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:keemob    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:cordova-plugin-x5-tbs    文件:X5WebViewClient.java   
/**
 * 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);
}
项目:cordova-plugin-x5-tbs    文件:X5WebViewClient.java   
/**
 * Gets the authentication token.
 * <p>
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
  AuthenticationToken token = null;
  token = this.authenticationTokens.get(host.concat(realm));

  if (token == null) {
    // try with just the host
    token = this.authenticationTokens.get(host);

    // Try the realm
    if (token == null) {
      token = this.authenticationTokens.get(realm);
    }

    // if no host found, just query for default
    if (token == null) {
      token = this.authenticationTokens.get("");
    }
  }

  return token;
}
项目:alerta-fraude    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:alerta-fraude    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:localcloud_fe    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:localcloud_fe    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:localcloud_fe    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:localcloud_fe    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:siiMobilityAppKit    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:siiMobilityAppKit    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:cordova.plugins.X5WebView    文件:X5WebViewClient.java   
/**
 * 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);
}
项目:cordova.plugins.X5WebView    文件:X5WebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:DinningShare    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:DinningShare    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:resin-configurator-client    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:resin-configurator-client    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:react-native-web-utf8map    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:react-native-web-utf8map    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:HybridAppReduxVsIonic    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:HybridAppReduxVsIonic    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:cordova-photosphere-example    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:cordova-photosphere-example    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:ShaPaoZi-Mobile    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:location-phonegap    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:location-phonegap    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}
项目:medicineReminder    文件:SystemWebViewClient.java   
/**
 * 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);
}
项目:medicineReminder    文件:SystemWebViewClient.java   
/**
 * Gets the authentication token.
 *
 * In order it tries:
 * 1- host + realm
 * 2- host
 * 3- realm
 * 4- no host, no realm
 *
 * @param host
 * @param realm
 *
 * @return the authentication token
 */
public AuthenticationToken getAuthenticationToken(String host, String realm) {
    AuthenticationToken token = null;
    token = this.authenticationTokens.get(host.concat(realm));

    if (token == null) {
        // try with just the host
        token = this.authenticationTokens.get(host);

        // Try the realm
        if (token == null) {
            token = this.authenticationTokens.get(realm);
        }

        // if no host found, just query for default
        if (token == null) {
            token = this.authenticationTokens.get("");
        }
    }

    return token;
}