I’m trying out the Authentication component in Firebase.Firebase認証データの不一致
A) I have a situation where the web client javascript code firebase-app.js and firebase-auth.js 3.3.0...
firebase.auth().onAuthStateChanged
andfirebase.auth().currentUser
... return different expected logged in user values, than the jvm client [com.firebase/firebase-client-jvm "2.5.2"]. The JVM client returns null user data.
My JVM client code is taken from Firebase’s QuickStart Guide . In the JVM client, neither
onAuthStateChanged
handler is called, nor doesfirebaseObj.getAuth()
return any data.I’m wondering where the discrepancy is. The web client was initialized with “codepairio.firebaseapp.com”.
var config = { ... authDomain: “<my-firebase-app>.firebaseapp.com" }; firebase.initializeApp(config);
B) The java client was initialized with “https://.firebaseio.com”. I’m using this URL as it’s specified in the guide and mentioned here . Also, if you try to use “.firebaseapp.com”, you’ll get an error: “IllegalStateException For a custom firebase host you must first set your authentication server before using authentication features!”.
So with that out of the way, we have...
new Firebase("https://<my-firebase-app>.firebaseio.com”);
Any ideas on how to get them to observe the same source of truth?
====> [EDIT]
[OK]を、私は少しさらに得ています。私は古いFirebase API(A)を最新のもの(B)よりも使用していました。
A)https://www.firebase.com/docs/android/guide/user-auth.html
B)https://firebase.google.com/docs/auth/server/
我々は、ユーザのを処理する方法のためFirebase's documentationを見るのであれば、我々はこの参照してください。
A Firebase User object represents the account of a user who has signed up to an app in your Firebase project. Apps usually have many registered users, and every app in a Firebase project shares a user database.
A Firebase User instance is independent from a Firebase Auth instance. This means that you can have several references to different users within the same context and still call any of their methods.
しかし、私を)という概念FirebaseAuth.getInstance().getCurrentUser()
のアプリが複数のユーザーを扱っている場合は意味がありません。さらに、FirebaseAuth.getInstance().getCurrentUser()
メソッドは存在しません。 FirebaseAuth
クラスファイル(com.firebase/firebase-client-jvm "2.5.2")には、the documentationが反映されません。
$ javap -classpath ~/.m2/repository/com/google/firebase/firebase-server-sdk/3.0.1/firebase-server-sdk-3.0.1.jar com.google.firebase.auth.FirebaseAuth
Compiled from "FirebaseAuth.java"
public class com.google.firebase.auth.FirebaseAuth {
public static com.google.firebase.auth.FirebaseAuth getInstance();
public static synchronized com.google.firebase.auth.FirebaseAuth getInstance(com.google.firebase.FirebaseApp);
public java.lang.String createCustomToken(java.lang.String);
public java.lang.String createCustomToken(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>);
public com.google.firebase.tasks.Task<com.google.firebase.auth.FirebaseToken> verifyIdToken(java.lang.String);
static com.google.api.client.json.JsonFactory access$000();
static com.google.firebase.auth.internal.FirebaseTokenVerifier access$100(com.google.firebase.auth.FirebaseAuth);
static {};
}
C)はこれまでのところ、サーバー上で、Firebaseの認証サービスを使用すると、現時点では私にとって非常に不透明です。誰かが複数のユーザーを処理する、ログインしたユーザーのリストを取得する、リクエストトークンを持つユーザーを確認するなどのセマンティクスを明確にすることはできますか?