Auth State Managment for Firebase in Android -


i see firebase documentation states no user-auth information stored during login process. however, have few questions how handle internally.

  • does firebase android sdk keep authentication state in memory? if does, design or pattern used purpose (singleton, weakreferences, etc) ?

  • or execute call server each time ref.getauth() method called?

thanks!

i assume you're referring section of documentation describes how store such user data in database yourself. states:

when authenticate user, no profile or user state stored in firebase database.

firebase authentication separate service firebase database, though integrate nicely.

when sign in user firebase authentication firebase client stores resulting token in app's sharedpreferences. means survives application restarts (although may expire while app not active).

the authentication state kept in memory. firebase objects share same session behind scenes, there's single object between of them. means can have single authenticated user amongst firebase references.

calling getauth() not call firebase servers, why it's 1 of few firebase api calls synchronous.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -