Firebase Authentication Limits

后端 未结 1 1427
礼貌的吻别
礼貌的吻别 2020-12-11 12:12

I am new to Firebase so any insights appreciated. I\'m writing Java server side test code. I grab several users from an database and am trying to migrate the data into user

1条回答
  •  爱一瞬间的悲伤
    2020-12-11 12:51

    If you are authenticating as different users because of security rules, using a server token is the better solution.

    A Firebase connection can only have at most one user authenticated at any given time. However in the Firebase Java library there is an undocumented (and not officially supported) workaround to create multiple independent connections. In a class that is in the package com.firebase.client you can run the following code

    // important this code needs to be in the package com.firebase.client
    Config config1 = new Config();
    Config config2 = new Config();
    Firebase ref1 = new Firebase("https://.firebaseio.com", config1);
    Firebase ref2 = new Firebase("https://.firebaseio.com", config2);
    // ref1 and ref2 will now have independent connections, listeners and authentication states
    

    Note that these will also open independent connections to the server.

    0 讨论(0)
提交回复
热议问题