Authentication
Learn how to integrate authentication in your app
Android Blaze provides ready made UI that you can use in order to integrate authentication in your app.
Authentication is handled by Firebase Auth. This gives you full access to the signed in user and full functionality that Firebase Auth provides. Currently supported sign in providers are Google, Apple and Facebook.
Using the Built-in Authentication UI
The AuthenticationScreen()
is a standard Sign-In with Email and Password. Pass your preferred Social Sign provider via the providers parameter.
Example of usage:
AuthenticationScreen(
providers = listOf(
SocialIdentityProvider.Google,
SocialIdentityProvider.Facebook,
),
onSignedIn = {
// TODO navigate to signed in
}
)
Social Sign In Buttons
We provide various Social Sign-in composables that you can integrate in your UI. Those composables handle both the UI and the social sign in mechanism
See the SocialButtons.kt
for all available components.
Example of Sign In with Google:
GoogleSignInButton(
onAuthComplete = {
// user signed in
},
onAuthError = { error ->
// an error occured.
},
)
How to access current user
You have full access to Firebase Authentication using Firebase.auth
. We provide the Firebase.auth.signedInUser
extension function which will emit the current user on new sign-in and sign-out.