@@ -13,7 +13,7 @@ providers such as Google Sign-In, and Facebook Login. It is built on top of
13
13
14
14
The best practices embodied in FirebaseUI aim to maximize sign-in
15
15
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 )
17
17
to store and retrieve credentials, enabling automatic and single-tap sign-in to
18
18
your app for returning users. It also handles tricky use cases like
19
19
account recovery and account linking that are security sensitive and
@@ -38,7 +38,6 @@ and [Web](https://github.com/firebase/firebaseui-web/).
38
38
1 . [ Usage instructions] ( #using-firebaseui-for-authentication )
39
39
1 . [ AuthUI sign-in] ( #authui-sign-in )
40
40
1 . [ Handling responses] ( #handling-the-sign-in-response )
41
- 1 . [ Silent sign-in] ( #silent-sign-in )
42
41
1 . [ Sign out] ( #sign-out )
43
42
1 . [ Account deletion] ( #deleting-accounts )
44
43
1 . [ Upgrading Anonymous Users] ( #upgrading-anonymous-users )
@@ -65,7 +64,7 @@ Gradle, add the dependency:
65
64
``` groovy
66
65
dependencies {
67
66
// ...
68
- implementation 'com.firebaseui:firebase-ui-auth:8 .0.2 '
67
+ implementation 'com.firebaseui:firebase-ui-auth:9 .0.0 '
69
68
70
69
// Required only if Facebook login support is required
71
70
// Find the latest Facebook SDK releases here: https://github.com/facebook/facebook-android-sdk/blob/master/CHANGELOG.md
@@ -406,45 +405,19 @@ Intent signInIntent =
406
405
.build();
407
406
```
408
407
409
- ##### Smart Lock
408
+ ##### Credential Manager
410
409
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 )
412
411
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:
416
415
417
416
```java
418
417
Intent signInIntent =
419
418
AuthUI.getInstance()
420
419
.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)
448
421
.build();
449
422
```
450
423
@@ -603,48 +576,13 @@ if (metadata.getCreationTimestamp() == metadata.getLastSignInTimestamp()) {
603
576
}
604
577
```
605
578
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
-
640
579
### Sign out
641
580
642
581
With the integrations provided by AuthUI , signing out a user is a multi- stage process:
643
582
644
583
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.
648
586
1. If the current user signed in using either Google or Facebook , the user must
649
587
also be signed out using the associated API for that authentication method.
650
588
This typically ensures that the user will not be automatically signed- in
@@ -677,7 +615,7 @@ if (v.getId() == R.id.sign_out) {
677
615
With the integrations provided by FirebaseUI Auth , deleting a user is a multi- stage process:
678
616
679
617
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
681
619
that they are not automatically prompted to # with a saved credential in the future.
682
620
683
621
This process is encapsulated by the `AuthUI . delete()` method, which returns a `Task ` representing
0 commit comments