Firebase Java客户端身份验证
正在尝试创建独立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() {
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工作?您的环境中是否有代理?我想如果有……你应该复习一下。。。。