Skip to content

3.2.0: SmartLock Email picker always shown #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
porkyhead opened this issue Jan 23, 2018 · 16 comments
Closed

3.2.0: SmartLock Email picker always shown #1118

porkyhead opened this issue Jan 23, 2018 · 16 comments
Assignees
Milestone

Comments

@porkyhead
Copy link

  • Android device: Google Pixel
  • Android OS version: 8.1
  • Google Play Services version: 11.8.0
  • Firebase/Play Services SDK version: 11.8.0
  • FirebaseUI version: 3.2.0

After upgrading to version 3.2.0 Smartlock email picker is shown even though authentcation is set to phone or Facebook. After email picker has been closed, the correct flow follows.

     startActivityForResult(
              AuthUI.getInstance()
                      .createSignInIntentBuilder()
                      .setLogo(R.drawable.ic_happenings)
                      .setPrivacyPolicyUrl(getString(R.string.privacy_policy_link))
                      .setAvailableProviders(
                              Arrays.asList(
                                      new AuthUI.IdpConfig.PhoneBuilder().build()
                              ))
                      .build(),
              RC_SIGN_IN);
@samtstern
Copy link
Contributor

@porkyhead can you provide a little more detail? Do you mean this picker?
smartlock

That is shown when you have previously saved an account with FirebaseUI and allows you to log in with a single tap. It's the intended behavior for now.

Or do you mean something else?

@RuiVarela
Copy link

RuiVarela commented Jan 23, 2018

upgrading to 3.2.0 is hell of a ride. that behavior changed out of nowhere...

I currently disabled smartlock
.setIsSmartLockEnabled(false),
to set the same behavior as before,

you also need to clear your app data

@samtstern
Copy link
Contributor

@RuiVarela can you help explain what changed exactly?

@RuiVarela
Copy link

RuiVarela commented Jan 23, 2018

sure,

if you use this snippet

        m_activity.startActivityForResult(
                AuthUI.getInstance()
                        .createSignInIntentBuilder()
                        .setAvailableProviders(Arrays.asList(new AuthUI.IdpConfig.PhoneBuilder().build()))
                        .build(),
                REQUEST_LOGIN_PHONE);

which was what we used, and if you have a picker with "email, phone, facebook, etc..." we were expecting that by using the phone you would be directed to phone validation screen,
but now it pops up a smart lock thing, which is surprising for the user and that eventual crashes the app

01
02
03

01-23 17:31:19.617 11831-11831/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: co.triller.droid, PID: 11831
                                                   java.lang.IllegalStateException: Provider password couldn't not be found in [IdpConfig{mProviderId='phone', mParams=Bundle[EMPTY_PARCEL]}]
                                                       at com.firebase.ui.auth.util.a.b.a(ProviderUtils.java:104)
                                                       at com.firebase.ui.auth.ui.email.EmailActivity.c(EmailActivity.java:123)
                                                       at com.firebase.ui.auth.ui.email.a$2.a(CheckEmailFragment.java:203)
                                                       at com.firebase.ui.auth.ui.email.a$2.onSuccess(CheckEmailFragment.java:199)
                                                       at com.google.android.gms.tasks.zzj.run(Unknown Source)
                                                       at android.os.Handler.handleCallback(Handler.java:751)
                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       at android.os.Looper.loop(Looper.java:154)
                                                       at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

to keep the old behaviour, of not showing up the "User accounts list" I disabled the smart lock

@RuiVarela
Copy link

RuiVarela commented Jan 23, 2018

the expression "Continue With" is really not explanatory of what is happening, I just thought that I was going through the email validation process

@samtstern
Copy link
Contributor

@RuiVarela ah ok thanks, I see what's happening here. At some point you must have enabled the email flow (maybe in testing) and gone far enough to save an email credential.

If in your production app you've only ever called setAvailableProviders() with the phone config then your users will never see this error, but we could be more defensive anyway.

I'll see what I can do.

@samtstern samtstern self-assigned this Jan 23, 2018
@samtstern samtstern added this to the 3.2.1 milestone Jan 23, 2018
@samtstern
Copy link
Contributor

Also to be clear, FirebaseUI no control over the "continue with" messaging or the styling of that email dialog, that comes directly from SmartLock.

@SUPERCILEX
Copy link
Collaborator

@samtstern sorry for the late reply, I'm pretty sure it doesn't have to do with providers but instead the new credential client. We have to redo something like #708. I'm seeing the same behavior as people here in that all my emails and Google accounts are showing up at the beginning.

@samtstern
Copy link
Contributor

@SUPERCILEX got it, I am digging into this now.

@SUPERCILEX
Copy link
Collaborator

Awesome!

@samtstern
Copy link
Contributor

@SUPERCILEX I see that we always set setPasswordLoginSupported to true. Were we saving phone number credentials as password credentials or something?

@SUPERCILEX
Copy link
Collaborator

@samtstern Not yet, but I did add support to save phone numbers in #962 and plan on bringing that over at some point. Currently tracked down the issue to ff16d0d#diff-741502abb522ecd56e7c30231e015bdbL138, investigating.

@SUPERCILEX
Copy link
Collaborator

Bingo! PR in a sec.

@samtstern
Copy link
Contributor

@SUPERCILEX nice! Btw the reason we don't save phone numbers is because SmartLock does a pretty bad job of presenting them properly in the UI. So I'm tracking an internal bug to improve that.

@SUPERCILEX
Copy link
Collaborator

@samtstern Oh sweet! I do remember having to hack it in, glad to know improvements are coming! 😄

@samtstern
Copy link
Contributor

This has been fixed and released in 3.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants