I have been looking and playing with Firebase and I found it really interesting.
So far I have tried some simple authentication and security policy setting but now I
You will control access by writing to a path in Firebase whenever a user logs in. Then you can check that path to ensure only one user exists at a time:
logged_in_users/$user_id)This takes care of the UX portion. To secure it against exploits, you will take advantage of Firebase's comprehensive security rules:
Assuming you've generated tokens containing an IP address, your security rules could look something like the following:
".read": "root.child('logged_in_users/'+auth.uid).val() === auth.ip_address"