Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 authenticated nodes within Firebase. My code selects a few users from the DB and spins up a new thread for each user.

The first thread connects and authenticates successfully. Subsequent simultaneous authentication attempts fail with the error message below. Each thread has its own instance of a Firebase reference object. Is there a restriction on the number of simultaneous logins, perhaps from the same IP address? Haven't been able to find anything in the documentation yet.

If I change the code to run in a single thread and login and logout each user one by one then I do not receive an error.

Any insights much appreciated.

Message: -5
Message: Due to another authentication attempt, this authentication attempt was aborted before it could complete.

            Firebase ref = new Firebase("https://<instance>.firebaseio.com/");

            ref.authWithPassword(mEmail, mPassword, new Firebase.AuthResultHandler() {
            @Override
            public void onAuthenticated(AuthData authData) {
                System.out.println("Successfully authenticated: " + mEmail);
                user.setUID(authData.getUid());
                user.setCurrentUserRef(ref);
                done.set(true);
            }

            @Override
            public void onAuthenticationError(FirebaseError firebaseError) {
                System.out.println("Error during authentication: " + mEmail);
                System.out.println("Error during authentication: " + ref.toString());

                System.out.println("Message: " + firebaseError.getCode());
                System.out.println("Message: " + firebaseError.getDetails());
                System.out.println("Message: " + firebaseError.getMessage());

                done.set(true);
            }});
            waitForCompletion(this.getClass().getName());
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
326 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...