Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase Java客户端身份验证_Java_Api_Authentication_Client_Firebase - Fatal编程技术网

Firebase Java客户端身份验证

Firebase Java客户端身份验证,java,api,authentication,client,firebase,Java,Api,Authentication,Client,Firebase,正在尝试创建独立Java应用程序,但无法进行身份验证 import com.firebase.client.*; public class Main { public static void main(String[] args) { Firebase ref = new Firebase("https://myURL.firebaseio.com/"); ref.authAnonymously(new Firebase.AuthResultHandler() {

正在尝试创建独立Java应用程序,但无法进行身份验证

import com.firebase.client.*;

public class Main {

  public static void main(String[] args) {

    Firebase ref = new Firebase("https://myURL.firebaseio.com/");   
    ref.authAnonymously(new Firebase.AuthResultHandler() {

      @Override
      public void onAuthenticationError(FirebaseError arg0) {               
        System.out.println("Not Authenticated: " + arg0);               
      }

      @Override
      public void onAuthenticated(AuthData arg0) {
        System.out.println("Authenticated.");
      }
    });
  }
}
始终引发以下身份验证错误:

    Not Authenticated: FirebaseError: There was an exception while connecting to the authentication server: Connection refused: connect
注:

使用authWithPassword得到相同的结果 可以从命令行ping URL 匿名身份验证在身份验证主机站点上打开 匿名身份验证通过web应用程序工作 使用firebase-client-jvm-2.0.0.jar
有什么建议吗?

我们是通过android设备还是vanilla Java进行身份验证?此错误是否一直存在或是暂时的?您在什么环境中运行并执行正常的sets/addValueEventListener工作?您的环境中是否有代理?我想如果有……你应该复习一下。。。。