@@ -13,7 +13,7 @@ providers such as Google Sign-In, and Facebook Login. It is built on top of
1313
1414The best practices embodied in FirebaseUI aim to maximize sign-in
1515and 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 )
1717to store and retrieve credentials, enabling automatic and single-tap sign-in to
1818your app for returning users. It also handles tricky use cases like
1919account recovery and account linking that are security sensitive and
@@ -38,7 +38,6 @@ and [Web](https://github.com/firebase/firebaseui-web/).
38381 . [ 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
6665dependencies {
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 )
412411to 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
418417Intent 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
642581With the integrations provided by AuthUI , signing out a user is a multi- stage process:
643582
6445831. 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.
6485861. 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) {
677615With the integrations provided by FirebaseUI Auth , deleting a user is a multi- stage process:
678616
6796171. 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 sign in with a saved credential in the future.
682620
683621This process is encapsulated by the `AuthUI . delete()` method, which returns a `Task ` representing
0 commit comments