The entry point of the Firebase Authentication SDK.
First, obtain an instance of this class by calling
Then, sign up or sign in a user with one of the following methods:
getCurrentUser()to get a
FirebaseUserobject, which contains information about the signed-in user.
Nested Class Summary
|interface||FirebaseAuth.AuthStateListener||Listener called when there is a change in the authentication state.|
|interface||FirebaseAuth.IdTokenListener||Listener called when the id token is changed.|
Public Method Summary
Signs in the user anonymously without requiring any credential.
Signs out the current user and clears it from the disk cache.
Sets the user-facing language code to be the default app language.
Inherited Method Summary
public void addAuthStateListener (FirebaseAuth.AuthStateListener listener)
Registers a listener to changes in the user authentication state. There can be more
than one listener registered at the same time for one or more
The listeners call back in the UI thread, on the following events:
- Right after the listener has been registered
- When a user signs in
- When the current user signs out
- When the current user changes
It is a recommended practice to always listen to sign-out events, as you may want to prompt the user to sign in again and maybe restrict the information or actions they have access to.
removeAuthStateListener(AuthStateListener) to unregister a listener.
addIdTokenListener(IdTokenListener) if you want to listen to token