/**
   * 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
   *
   * @param view
   * @param handler
   * @param host
   * @param realm
   */
  @Override
  public void onReceivedHttpAuthRequest(
      XWalkView view, XWalkHttpAuthHandler handler, String host, String realm) {

    // Get the authentication token
    AuthenticationToken token = getAuthenticationToken(host, realm);
    if (token != null) {
      handler.proceed(token.getUserName(), token.getPassword());
    } else {
      // Handle 401 like we'd normally do!
      super.onReceivedHttpAuthRequest(view, handler, host, realm);
    }
  }