From e49d6c2e78ace2857ec9f4765e08e864746cf98b Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Fri, 20 Mar 2026 10:52:18 +0000 Subject: [PATCH 1/9] docs: getting started on android FirebaseUI v10 --- GETTING_STARTED.md | 268 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 GETTING_STARTED.md diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md new file mode 100644 index 000000000..a81fca145 --- /dev/null +++ b/GETTING_STARTED.md @@ -0,0 +1,268 @@ +# FirebaseUI Auth for Android + +FirebaseUI Auth is a modern, Compose-based authentication library for Firebase Authentication on Android. + +`10.x` is currently a beta release. + +If you used the older FirebaseUI Auth guides, the biggest change in `10.x` is that the recommended sign-in flow now uses Compose screens instead of `Intent` builders and `ActivityResultLauncher` callbacks. + +FirebaseUI Auth provides the following benefits: + +- Credential Manager integration for faster sign-in on Android. +- Material 3 UI that can inherit your app theme. +- Multiple authentication providers, including email/password, phone, Google, Facebook, Apple, GitHub, Microsoft, Yahoo, Twitter, anonymous auth, and custom OAuth. +- Multi-factor authentication support, including SMS and TOTP. +- Built-in flows for account management, account linking, and anonymous user upgrade. + +## Before you begin + +1. [Add Firebase to your Android project](https://firebase.google.com/docs/android/setup). +2. Make sure your app is set up for Jetpack Compose. +3. In the [Firebase console](https://console.firebase.google.com/), enable the sign-in methods you want to support. + +Add FirebaseUI Auth to your app module: + +```kotlin +dependencies { + implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta02") + + // Most apps also declare Firebase and Compose dependencies directly. + implementation(platform("com.google.firebase:firebase-bom:")) + implementation("com.google.firebase:firebase-auth") + + implementation(platform("androidx.compose:compose-bom:")) + implementation("androidx.compose.material3:material3") + + // Required only if Facebook Login support is needed + implementation("com.facebook.android:facebook-login:") +} +``` + +The high-level FirebaseUI Auth API is Compose-based, so if your app is not already using Compose you will need to enable it first. + +## Provider configuration + +Some providers need additional setup before you can sign users in. + +### Google Sign-In + +- Enable Google in the Firebase console. +- Add your app's SHA fingerprint in Firebase. +- Download the updated `google-services.json`. +- `AuthProvider.Google(..., serverClientId = null)` can use the `default_web_client_id` generated by the `google-services` Gradle plugin. + +### Facebook Login + +If you support Facebook Login, add these values to `strings.xml`: + +```xml + + YOUR_FACEBOOK_APP_ID + fbYOUR_FACEBOOK_APP_ID + YOUR_FACEBOOK_CLIENT_TOKEN + +``` + +### Other providers + +Apple, GitHub, Microsoft, Yahoo, Twitter, and custom OAuth providers are configured in Firebase Authentication. Most of them do not require extra Android-specific resources. + +## Sign in + +Create an `AuthUIConfiguration`, then show `FirebaseAuthScreen`. + +```kotlin +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val authUI = FirebaseAuthUI.getInstance() + + setContent { + MyAppTheme { + val configuration = authUIConfiguration { + context = applicationContext + theme = AuthUITheme.fromMaterialTheme() + providers { + provider(AuthProvider.Email()) + provider( + AuthProvider.Google( + scopes = listOf("email"), + serverClientId = null, + ) + ) + } + } + + if (authUI.isSignedIn()) { + HomeScreen() + } else { + FirebaseAuthScreen( + configuration = configuration, + authUI = authUI, + onSignInSuccess = { result -> + // User signed in successfully + }, + onSignInFailure = { exception -> + // Sign in failed + }, + onSignInCancelled = { + finish() + }, + ) + } + } + } + } +} +``` + +This gives you a complete authentication flow with: + +- Email/password sign-in and sign-up. +- Google Sign-In. +- Password reset. +- Material 3 styling. +- Credential Manager support. +- Error handling through direct callbacks. + +## Configure providers + +Choose the providers you want inside `authUIConfiguration`: + +```kotlin +val configuration = authUIConfiguration { + context = applicationContext + providers { + provider(AuthProvider.Email()) + provider( + AuthProvider.Phone( + defaultCountryCode = "US", + ) + ) + provider( + AuthProvider.Google( + scopes = listOf("email"), + serverClientId = null, + ) + ) + provider(AuthProvider.Facebook()) + } +} +``` + +### Email link sign-in + +Email link sign-in now lives in the email provider configuration: + +```kotlin +val configuration = authUIConfiguration { + context = applicationContext + providers { + provider( + AuthProvider.Email( + isEmailLinkSignInEnabled = true, + emailLinkActionCodeSettings = actionCodeSettings { + url = "https://example.com/auth" + handleCodeInApp = true + setAndroidPackageName( + "com.example.app", + true, + null, + ) + }, + ) + ) + } +} +``` + +For the full deep-link handling flow, see `auth/README.md`. + +## Sign out + +FirebaseUI Auth provides convenience methods for sign-out and account deletion: + +```kotlin +lifecycleScope.launch { + FirebaseAuthUI.getInstance().signOut(applicationContext) +} +``` + +```kotlin +lifecycleScope.launch { + FirebaseAuthUI.getInstance().delete(applicationContext) +} +``` + +## Customization + +FirebaseUI Auth is much more customizable in `10.x`, but the simplest way to get started is to set a theme directly in `authUIConfiguration`: + +```kotlin +val configuration = authUIConfiguration { + context = applicationContext + providers { + provider(AuthProvider.Email()) + provider(AuthProvider.Google(scopes = listOf("email"), serverClientId = null)) + } + theme = AuthUITheme.Adaptive +} +``` + +You can also: + +- Use `AuthUITheme.Default`, `AuthUITheme.DefaultDark`, or `AuthUITheme.Adaptive`. +- Inherit your app theme with `AuthUITheme.fromMaterialTheme()`. +- Customize the default theme with `.copy()`. +- Build a fully custom `AuthUITheme`. +- Set a logo, Terms of Service URL, and Privacy Policy URL in `authUIConfiguration`. + +For full theming and customization details, including theme precedence, provider button styling, and custom themes, see `auth/README.md`. + +## Existing Activity-based apps + +If your app still uses Activities and the Activity Result API, you can keep an Activity-based launch flow by using `AuthFlowController`: + +```kotlin +private val authLauncher = registerForActivityResult( + ActivityResultContracts.StartActivityForResult(), +) { result -> + if (result.resultCode == RESULT_OK) { + val user = FirebaseAuth.getInstance().currentUser + // ... + } else { + // User cancelled or sign-in failed + } +} + +val configuration = authUIConfiguration { + context = applicationContext + providers { + provider(AuthProvider.Email()) + provider( + AuthProvider.Google( + scopes = listOf("email"), + serverClientId = null, + ) + ) + } +} + +val controller = FirebaseAuthUI.getInstance().createAuthFlow(configuration) +authLauncher.launch(controller.createIntent(this)) +``` + +This is the closest match to the old FirebaseUI Auth mental model, but the Compose `FirebaseAuthScreen` API is the recommended starting point for new integrations. + +## Migrating from the old FirebaseUI Auth flow + +If you are coming from `9.x` or the older Firebase documentation: + +- `AuthUI.getInstance().createSignInIntentBuilder()` becomes `authUIConfiguration {}` plus `FirebaseAuthScreen`. +- `AuthUI.IdpConfig.*Builder()` becomes `AuthProvider.*`. +- XML-based FirebaseUI theme resources become `AuthUITheme`. +- `ActivityResultLauncher` result parsing becomes direct success, failure, and cancel callbacks. +- Activity-based flows are still possible through `AuthFlowController`. + +For a complete migration guide, see `auth/README.md` and `docs/upgrade-to-10.0.md`. From 3bd98f4478da451146527c0437c583605381fdbb Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 24 Mar 2026 09:37:55 +0000 Subject: [PATCH 2/9] docs: write were latest version of firebase auth can be found --- GETTING_STARTED.md | 12 ++++++------ docs/upgrade-to-10.0.md | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index a81fca145..60ff05ab7 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -24,17 +24,17 @@ Add FirebaseUI Auth to your app module: ```kotlin dependencies { + // Check Maven Central for the latest version: + // https://central.sonatype.com/artifact/com.firebaseui/firebase-ui-auth/versions implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta02") - // Most apps also declare Firebase and Compose dependencies directly. - implementation(platform("com.google.firebase:firebase-bom:")) - implementation("com.google.firebase:firebase-auth") - + // Required: Jetpack Compose implementation(platform("androidx.compose:compose-bom:")) implementation("androidx.compose.material3:material3") - // Required only if Facebook Login support is needed - implementation("com.facebook.android:facebook-login:") + // Required only if Facebook login support is required + // Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94 + implementation("com.facebook.android:facebook-android-sdk:8.x") } ``` diff --git a/docs/upgrade-to-10.0.md b/docs/upgrade-to-10.0.md index 2a97ddd5b..d870cf361 100644 --- a/docs/upgrade-to-10.0.md +++ b/docs/upgrade-to-10.0.md @@ -48,7 +48,9 @@ dependencies { ```kotlin dependencies { // FirebaseUI Auth - implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta01") + // Check Maven Central for the latest version: + // https://central.sonatype.com/artifact/com.firebaseui/firebase-ui-auth/versions + implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta02") // Required: Jetpack Compose implementation(platform("androidx.compose:compose-bom:2024.01.00")) From b4e880ae3034da3fa74f74ff665788a1fdb2768a Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 24 Mar 2026 09:42:37 +0000 Subject: [PATCH 3/9] docs: update jetpack compose version and link to docs --- GETTING_STARTED.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 60ff05ab7..d4a778c20 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -29,7 +29,9 @@ dependencies { implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta02") // Required: Jetpack Compose - implementation(platform("androidx.compose:compose-bom:")) + // Find the latest Compose BOM version here: + // https://developer.android.com/develop/ui/compose/bom + implementation(platform("androidx.compose:compose-bom:2026.03.00")) implementation("androidx.compose.material3:material3") // Required only if Facebook login support is required From 94710882f512941078f5e507b47607ae64513fa0 Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 24 Mar 2026 10:17:55 +0000 Subject: [PATCH 4/9] docs: add link to apps still using activities --- GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index d4a778c20..b7f31eddb 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -4,7 +4,7 @@ FirebaseUI Auth is a modern, Compose-based authentication library for Firebase A `10.x` is currently a beta release. -If you used the older FirebaseUI Auth guides, the biggest change in `10.x` is that the recommended sign-in flow now uses Compose screens instead of `Intent` builders and `ActivityResultLauncher` callbacks. +If you used the older FirebaseUI Auth guides, the biggest change in `10.x` is that the recommended sign-in flow now uses Compose screens instead of `Intent` builders and `ActivityResultLauncher` callbacks. For apps that still use Activities, see [Existing Activity-based apps](#existing-activity-based-apps). FirebaseUI Auth provides the following benefits: From a530e830418b27f7dfb585ed51d92f7329403a1f Mon Sep 17 00:00:00 2001 From: Russell Wheatley Date: Tue, 7 Apr 2026 11:18:58 +0100 Subject: [PATCH 5/9] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rosário P. Fernandes --- GETTING_STARTED.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index b7f31eddb..b50d65d30 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -1,10 +1,10 @@ -# FirebaseUI Auth for Android +# Easily add sign-in to your Android app with FirebaseUI -FirebaseUI Auth is a modern, Compose-based authentication library for Firebase Authentication on Android. +[FirebaseUI](https://github.com/firebase/firebaseui-android) Auth is a library built on top of the Firebase Authentication SDK that provides drop-in UI flows for use in your app. -`10.x` is currently a beta release. +Caution: Version 10.x is currently a **beta release**. This means that the functionality might change in backward-incompatible ways or have limited support. A beta release is not subject to any SLA or deprecation policy. -If you used the older FirebaseUI Auth guides, the biggest change in `10.x` is that the recommended sign-in flow now uses Compose screens instead of `Intent` builders and `ActivityResultLauncher` callbacks. For apps that still use Activities, see [Existing Activity-based apps](#existing-activity-based-apps). +If you used the older FirebaseUI Auth guides, the biggest change in `10.x` is that the recommended sign-in flow now uses Compose screens instead of `Intent` builders and `ActivityResultLauncher` callbacks. For apps that still use Activities, see the [Existing Activity-based apps](#existing-activity-based-apps) section. FirebaseUI Auth provides the following benefits: @@ -16,7 +16,7 @@ FirebaseUI Auth provides the following benefits: ## Before you begin -1. [Add Firebase to your Android project](https://firebase.google.com/docs/android/setup). +1. If you haven't already, [add Firebase to your Android project](https://firebase.google.com/docs/android/setup). 2. Make sure your app is set up for Jetpack Compose. 3. In the [Firebase console](https://console.firebase.google.com/), enable the sign-in methods you want to support. @@ -48,7 +48,7 @@ Some providers need additional setup before you can sign users in. ### Google Sign-In -- Enable Google in the Firebase console. +- Enable Google Sign-in in the Firebase console. - Add your app's SHA fingerprint in Firebase. - Download the updated `google-services.json`. - `AuthProvider.Google(..., serverClientId = null)` can use the `default_web_client_id` generated by the `google-services` Gradle plugin. @@ -121,7 +121,7 @@ class MainActivity : ComponentActivity() { This gives you a complete authentication flow with: -- Email/password sign-in and sign-up. +- Password Authentication. - Google Sign-In. - Password reset. - Material 3 styling. From 24c0c3eb9390fe060eafc496c0162aa5c8eb017e Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 7 Apr 2026 11:23:06 +0100 Subject: [PATCH 6/9] docs: update before you begin list --- GETTING_STARTED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index b50d65d30..5ecb58ed6 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -17,8 +17,8 @@ FirebaseUI Auth provides the following benefits: ## Before you begin 1. If you haven't already, [add Firebase to your Android project](https://firebase.google.com/docs/android/setup). -2. Make sure your app is set up for Jetpack Compose. -3. In the [Firebase console](https://console.firebase.google.com/), enable the sign-in methods you want to support. +2. In the [Firebase console](https://console.firebase.google.com/), enable the sign-in methods you want to support. +3. Add FirebaseUI Auth to your app module Add FirebaseUI Auth to your app module: From 928d2e5d6df7c2fe057517f630a1591d16d2d288 Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 7 Apr 2026 11:24:24 +0100 Subject: [PATCH 7/9] docs: remove jetpack compose dependencies from snippet --- GETTING_STARTED.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 5ecb58ed6..8bca400e4 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -28,12 +28,6 @@ dependencies { // https://central.sonatype.com/artifact/com.firebaseui/firebase-ui-auth/versions implementation("com.firebaseui:firebase-ui-auth:10.0.0-beta02") - // Required: Jetpack Compose - // Find the latest Compose BOM version here: - // https://developer.android.com/develop/ui/compose/bom - implementation(platform("androidx.compose:compose-bom:2026.03.00")) - implementation("androidx.compose.material3:material3") - // Required only if Facebook login support is required // Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94 implementation("com.facebook.android:facebook-android-sdk:8.x") From 8a77bf46d07b27e4206733940568cc7d4fdd8dab Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 7 Apr 2026 11:24:54 +0100 Subject: [PATCH 8/9] docs: scrub mention of compose --- GETTING_STARTED.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 8bca400e4..41469905b 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -34,8 +34,6 @@ dependencies { } ``` -The high-level FirebaseUI Auth API is Compose-based, so if your app is not already using Compose you will need to enable it first. - ## Provider configuration Some providers need additional setup before you can sign users in. From bd44462e4938bc5b50c3818d748fa020a58e76a5 Mon Sep 17 00:00:00 2001 From: russellwheatley Date: Tue, 7 Apr 2026 11:32:42 +0100 Subject: [PATCH 9/9] docs: update provider links to help setup for firebase auth --- GETTING_STARTED.md | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 41469905b..17f07d9f5 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -36,30 +36,18 @@ dependencies { ## Provider configuration -Some providers need additional setup before you can sign users in. - -### Google Sign-In - -- Enable Google Sign-in in the Firebase console. -- Add your app's SHA fingerprint in Firebase. -- Download the updated `google-services.json`. -- `AuthProvider.Google(..., serverClientId = null)` can use the `default_web_client_id` generated by the `google-services` Gradle plugin. - -### Facebook Login - -If you support Facebook Login, add these values to `strings.xml`: - -```xml - - YOUR_FACEBOOK_APP_ID - fbYOUR_FACEBOOK_APP_ID - YOUR_FACEBOOK_CLIENT_TOKEN - -``` - -### Other providers - -Apple, GitHub, Microsoft, Yahoo, Twitter, and custom OAuth providers are configured in Firebase Authentication. Most of them do not require extra Android-specific resources. +Some providers need additional setup before you can sign users in: +- [Sign in with Google](https://firebase.google.com/docs/auth/android/google-signin) +- [Facebook Login](https://firebase.google.com/docs/auth/android/facebook-login) +- [Sign in with Apple](https://firebase.google.com/docs/auth/android/apple) +- [Sign in with Twitter](https://firebase.google.com/docs/auth/android/twitter-login) +- [Sign in with Github](https://firebase.google.com/docs/auth/android/github-auth) +- [Sign in with Microsoft](https://firebase.google.com/docs/auth/android/microsoft-oauth) +- [Sign in with Yahoo](https://firebase.google.com/docs/auth/android/yahoo-oauth) + +### Providers + +Apple, GitHub, Microsoft, Yahoo, Twitter and custom OAuth providers are configured in Firebase Authentication. Most of them do not require extra Android-specific resources. ## Sign in