Skip to content

Commit 6741de9

Browse files
authored
Merge branch 'version-9.0.0-dev' into rpf/upgrade-play-services
2 parents 28b8dc4 + e5d7a42 commit 6741de9

File tree

4 files changed

+64
-78
lines changed

4 files changed

+64
-78
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ libraries.
4848
```groovy
4949
dependencies {
5050
// FirebaseUI for Firebase Realtime Database
51-
implementation 'com.firebaseui:firebase-ui-database:8.0.2'
51+
implementation 'com.firebaseui:firebase-ui-database:9.0.0'
5252
5353
// FirebaseUI for Cloud Firestore
54-
implementation 'com.firebaseui:firebase-ui-firestore:8.0.2'
54+
implementation 'com.firebaseui:firebase-ui-firestore:9.0.0'
5555
5656
// FirebaseUI for Firebase Auth
57-
implementation 'com.firebaseui:firebase-ui-auth:8.0.2'
57+
implementation 'com.firebaseui:firebase-ui-auth:9.0.0'
5858
5959
// FirebaseUI for Cloud Storage
60-
implementation 'com.firebaseui:firebase-ui-storage:8.0.2'
60+
implementation 'com.firebaseui:firebase-ui-storage:9.0.0'
6161
}
6262
```
6363

@@ -71,6 +71,7 @@ After the project is synchronized, we're ready to start using Firebase functiona
7171
If you are using an old version of FirebaseUI and upgrading, please see the appropriate
7272
migration guide:
7373

74+
* [Upgrade from 8.0.2 to 9.x.x](./docs/upgrade-to-9.0.md)
7475
* [Upgrade from 7.2.0 to 8.x.x](./docs/upgrade-to-8.0.md)
7576
* [Upgrade from 6.4.0 to 7.x.x](./docs/upgrade-to-7.0.md)
7677
* [Upgrade from 5.1.0 to 6.x.x](./docs/upgrade-to-6.0.md)

auth/README.md

+11-73
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ providers such as Google Sign-In, and Facebook Login. It is built on top of
1313

1414
The best practices embodied in FirebaseUI aim to maximize sign-in
1515
and sign-up conversion for your app. It integrates with
16-
[Smart Lock for Passwords](https://developers.google.com/identity/smartlock-passwords/android/)
16+
[Credential Manager](https://developer.android.com/identity/sign-in/credential-manager)
1717
to store and retrieve credentials, enabling automatic and single-tap sign-in to
1818
your app for returning users. It also handles tricky use cases like
1919
account recovery and account linking that are security sensitive and
@@ -38,7 +38,6 @@ and [Web](https://github.com/firebase/firebaseui-web/).
3838
1. [Usage instructions](#using-firebaseui-for-authentication)
3939
1. [AuthUI sign-in](#authui-sign-in)
4040
1. [Handling responses](#handling-the-sign-in-response)
41-
1. [Silent sign-in](#silent-sign-in)
4241
1. [Sign out](#sign-out)
4342
1. [Account deletion](#deleting-accounts)
4443
1. [Upgrading Anonymous Users](#upgrading-anonymous-users)
@@ -65,7 +64,7 @@ Gradle, add the dependency:
6564
```groovy
6665
dependencies {
6766
// ...
68-
implementation 'com.firebaseui:firebase-ui-auth:8.0.2'
67+
implementation 'com.firebaseui:firebase-ui-auth:9.0.0'
6968
7069
// Required only if Facebook login support is required
7170
// Find the latest Facebook SDK releases here: https://github.com/facebook/facebook-android-sdk/blob/master/CHANGELOG.md
@@ -406,45 +405,19 @@ Intent signInIntent =
406405
.build();
407406
```
408407

409-
##### Smart Lock
408+
##### Credential Manager
410409

411-
By default, FirebaseUI uses [Smart Lock for Passwords](https://developers.google.com/identity/smartlock-passwords/android/)
410+
By default, FirebaseUI uses [Credential Manager](https://developer.android.com/identity/sign-in/credential-manager)
412411
to store the user's credentials and automatically sign users into your app on subsequent attempts.
413-
Using Smart Lock is recommended to provide the best user experience, but in some cases you may want
414-
to disable Smart Lock for testing or development. To disable Smart Lock, you can use the
415-
`setIsSmartLockEnabled` method when building your sign-in Intent:
412+
Using Credential Manager is recommended to provide the best user experience, but in some cases you may want
413+
to disable Credential Manager for testing or development. To disable Credential Manager, you can use the
414+
`setCredentialManagerEnabled` method when building your sign-in Intent:
416415
417416
```java
418417
Intent signInIntent =
419418
AuthUI.getInstance()
420419
.createSignInIntentBuilder()
421-
.setIsSmartLockEnabled(false)
422-
.build();
423-
```
424-
425-
###### Smart Lock hints
426-
427-
If you'd like to keep Smart Lock's "hints" but disable the saving/retrieving of credentials, then
428-
you can use the two-argument version of `setIsSmartLockEnabled`:
429-
430-
```java
431-
Intent signInIntent =
432-
AuthUI.getInstance()
433-
.createSignInIntentBuilder()
434-
.setIsSmartLockEnabled(false, true)
435-
.build();
436-
```
437-
438-
###### Smart Lock in dev builds
439-
440-
It is often desirable to disable Smart Lock in development but enable it in production. To achieve
441-
this, you can use the `BuildConfig.DEBUG` flag to control Smart Lock:
442-
443-
```java
444-
Intent signInIntent =
445-
AuthUI.getInstance()
446-
.createSignInIntentBuilder()
447-
.setIsSmartLockEnabled(!BuildConfig.DEBUG /* credentials */, true /* hints */)
420+
.setCredentialManagerEnabled(false)
448421
.build();
449422
```
450423
@@ -603,48 +576,13 @@ if (metadata.getCreationTimestamp() == metadata.getLastSignInTimestamp()) {
603576
}
604577
```
605578

606-
### Silent sign-in
607-
608-
If a user is not currently signed in, then a silent sign-in process can be started first before
609-
displaying any UI to provide a seamless experience. Silent sign-in uses saved Smart Lock credentials
610-
and returns a successful `Task` only if the user has been fully signed in with Firebase.
611-
612-
Here's an example of how you could use silent sign-in paired with Firebase anonymous sign-in to get
613-
your users up and running as fast as possible:
614-
615-
```java
616-
List<IdpConfig> providers = getSelectedProviders();
617-
AuthUI.getInstance().silentSignIn(this, providers)
618-
.continueWithTask(this, new Continuation<AuthResult, Task<AuthResult>>() {
619-
@Override
620-
public Task<AuthResult> then(@NonNull Task<AuthResult> task) {
621-
if (task.isSuccessful()) {
622-
return task;
623-
} else {
624-
// Ignore any exceptions since we don't care about credential fetch errors.
625-
return FirebaseAuth.getInstance().signInAnonymously();
626-
}
627-
}
628-
}).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
629-
@Override
630-
public void onComplete(@NonNull Task<AuthResult> task) {
631-
if (task.isSuccessful()) {
632-
// Signed in! Start loading data
633-
} else {
634-
// Uh oh, show error message
635-
}
636-
}
637-
});
638-
```
639-
640579
### Sign out
641580

642581
With the integrations provided by AuthUI, signing out a user is a multi-stage process:
643582

644583
1. The user must be signed out of the FirebaseAuth instance.
645-
1. Smart Lock for Passwords must be instructed to disable automatic sign-in, in
646-
order to prevent an automatic sign-in loop that prevents the user from
647-
switching accounts.
584+
1. Credential Manager must be instructed to clear the current user credential state from
585+
all credential providers.
648586
1. If the current user signed in using either Google or Facebook, the user must
649587
also be signed out using the associated API for that authentication method.
650588
This typically ensures that the user will not be automatically signed-in
@@ -677,7 +615,7 @@ if (v.getId() == R.id.sign_out) {
677615
With the integrations provided by FirebaseUI Auth, deleting a user is a multi-stage process:
678616

679617
1. The user must be deleted from Firebase Auth.
680-
1. Smart Lock for Passwords must be told to delete any existing Credentials for the user, so
618+
1. Credential Manager must be told to delete any existing Credentials for the user, so
681619
that they are not automatically prompted to # with a saved credential in the future.
682620

683621
This process is encapsulated by the `AuthUI.delete()` method, which returns a `Task` representing

buildSrc/src/main/kotlin/Config.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
object Config {
2-
const val version = "8.0.2"
2+
const val version = "9.0.0-SNAPSHOT"
33
val submodules = listOf("auth", "common", "firestore", "database", "storage")
44

55
private const val kotlinVersion = "2.1.0"

docs/upgrade-to-9.0.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Upgrading to FirebaseUI 9.0
2+
3+
FirebaseUI version `9.0.0` has significant breaking API changes and also adopts new major versions
4+
of many critical dependencies. Below is a description of each breaking change.
5+
6+
## All - Update to Firebase BoM 33
7+
8+
FirebaseUI now depends on the Firebase SDK at BoM major version `33.9.0`. You should update your
9+
app to use the same major version to avoid possible compilation errors or crashes.
10+
11+
For more information on this SDK release see the
12+
[Firebase Android SDK release notes](https://firebase.google.com/support/release-notes/android#bom_v33-9-0).
13+
14+
Release Notes for other BoM versions with breaking changes:
15+
- [Firebase Android SDK BoM 32.0.0](https://firebase.google.com/support/release-notes/android#bom_v32-0-0)
16+
- [Firebase Android SDK BoM 31.0.0](https://firebase.google.com/support/release-notes/android#bom_v31-0-0)
17+
- [Firebase Android SDK BoM 30.0.0](https://firebase.google.com/support/release-notes/android#bom_v30-0-0)
18+
- [Firebase Android SDK BoM 29.0.0](https://firebase.google.com/support/release-notes/android#bom_v29-0-0)
19+
20+
## Auth - Remove Smart Lock
21+
22+
[Smart Lock for Passwords](https://developers.google.com/identity/smartlock-passwords/android/overview)
23+
, which was deprecated in 2022, is now removed from the Google Play Services Auth SDK
24+
(`com.google.android.gms:play-services-auth`).
25+
FirebaseUI Android has been updated to use [Credential Manager](https://developer.android.com/training/sign-in/passkeys)
26+
instead.
27+
28+
Due to this change, some APIs have changed:
29+
30+
- The `AuthUI#setIsSmartLockEnabled(boolean enableCredentials)` method has been replaced with the new
31+
`setCredentialManagerEnabled(Boolean)` method.
32+
- The `AuthUI#setIsSmartLockEnabled(boolean enableCredentials, boolean enableHints)` method has been
33+
removed with no replacement (for now).
34+
- The `AuthUI#silentSignIn()` method has been removed with no replacement.
35+
36+
## Auth - (behavior change) new Email authentication flow
37+
38+
Versions 8.x and older of FirebaseUI relied on methods like `fetchSignInForEmail`, which
39+
now fail with the introduction of
40+
[Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection).
41+
42+
Version 9.0 removed those methods and now shows a different flow for email # and #.
43+
44+
## Auth - Removed SafetyNet
45+
46+
[Firebase Auth v22.0.0](https://firebase.google.com/support/release-notes/android#auth_v22-0-0)
47+
removed SafetyNet support for app verification during phone number authentication.

0 commit comments

Comments
 (0)