Firebase still retrieving user even after deletion

5,091 views
Skip to first unread message

Dheeraj Marda

unread,
Sep 2, 2016, 10:44:07 AM9/2/16
to Firebase Google Group
After I manually deleted the account connected to the user that my android phone is on (from firebase console). 
When I run the app again it is still authenticating and retrieving a user data. How to delete the session when i remove the user ?

Jacob Wenger

unread,
Sep 2, 2016, 12:41:38 PM9/2/16
to fireba...@googlegroups.com
The underlying ID token that authenticates refreshes every hour. So, after an account is deleted, the client will be authenticated for up to one hour. Only until it tries to refresh the ID token will the client become unauthenticated.

Cheers,
Jacob

On Fri, Sep 2, 2016 at 3:27 AM, Dheeraj Marda <dheera...@gmail.com> wrote:
After I manually deleted the account connected to the user that my android phone is on (from firebase console). 
When I run the app again it is still authenticating and retrieving a user data. How to delete the session when i remove the user ?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/01223c78-cffd-4840-960d-4a70a0b0a4a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dheeraj Marda

unread,
Sep 3, 2016, 11:01:51 AM9/3/16
to Firebase Google Group
Hey Jacob,

Nope i had deleted user from firebase console yesterday. It is still logged in. Do i need to change something in the default rule ?


On Friday, 2 September 2016 22:11:38 UTC+5:30, Jacob Wenger wrote:
The underlying ID token that authenticates refreshes every hour. So, after an account is deleted, the client will be authenticated for up to one hour. Only until it tries to refresh the ID token will the client become unauthenticated.

Cheers,
Jacob
On Fri, Sep 2, 2016 at 3:27 AM, Dheeraj Marda <dheera...@gmail.com> wrote:
After I manually deleted the account connected to the user that my android phone is on (from firebase console). 
When I run the app again it is still authenticating and retrieving a user data. How to delete the session when i remove the user ?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

Alfonso Gomez Jordana Manas

unread,
Sep 6, 2016, 11:32:04 AM9/6/16
to Firebase Google Group
Hi Dheeraj,

If the user is deleted and more than one hour has happened since such event, then:

1) auth().currentUser will still have the cached user
2) But an error will be thrown when trying to read/write in the Database authenticated as such user. It will not be possible for a deleted user (after 1 hour) to go through security rules that don't allow public access.

If you are seeing something inconsistent with what I described above, please reply back with code snippets (from security rules and your app) so we can help troubleshoot further :)

Alfonso

Dheeraj Marda

unread,
Sep 7, 2016, 10:33:53 AM9/7/16
to Firebase Google Group
Hello Alfonso,

Thanks for replying back to my query . As suggested by you i was looking at the oncancelled () method of the addValueEventListner.
But to my surprise it is not getting called at all after i delete the user from console .I know i can force user to sign out if their is error in read / write of database to solve my login issue.

I kindly request you to see if i am doing something wrong. 

//Copying the code of default security rule 

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}


// code snipped from my MainActivty.java

// onCreateMethod ()
// Read from the database
DatabaseReference myRef = database.getReference("test");
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// This method is called once with the initial value and again
// whenever data at this location is updated.
String value = dataSnapshot.getValue(String.class);
Toast.makeText(mContext,"Value is: " + value,Toast.LENGTH_LONG).show();
}

@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
Toast.makeText(mContext,"Failed to read value :"+ error.toException(),Toast.LENGTH_LONG).show();
}
});
 

Dheeraj Marda
Reply all
Reply to author
Forward
0 new messages