am using firebase authentication, I refer this [link](https://stackoverflow.com/questions/37517208/firebase-kicks-out-current-user)

```
"users": {
        ".read": "auth != null && root.child('admins').child(auth.uid).val() == true",
        ".write": "auth != null && (root.child('admins').child(auth.uid).val() == true)",
        "$uid": {
          ".read": "auth != null && (auth.uid == $uid || root.child('admins').child(auth.uid).val() == true)",
          ".write": "auth != null && (auth.uid == $uid || root.child('admins').child(auth.uid).val() == true)"
        }
      },

```

This is my firebase user table rules.

my services.js 

```
signupUser: function(newUser) {
          var secondaryApp = firebase.initializeApp(FirebaseAppConfig, "Secondary");
          var usersRef = firebase.database().ref().child('users');
          return secondaryApp.auth()
          .createUserWithEmailAndPassword(newUser.email, newUser.password)
          .then(function(firebaseUser) {
            secondaryApp.auth().signOut();

            var newUserWithoutPwd = _.extend({}, newUser);
            delete newUserWithoutPwd.password;
            return usersRef
            .child(firebaseUser.uid)
            .set(newUserWithoutPwd)
            .then(function() {
              return newUserWithoutPwd;
            });
          });
        },

```

Authendication is success. But user table show in permission denied error.

Show below screen shot

[![enter image description here](https://i.stack.imgur.com/FqEeB.png)](https://i.stack.imgur.com/FqEeB.png)