Closed HelaGone closed 4 years ago
@HelaGone does smartlock work when you're using Email/Password accounts? I believe we don't save any credential for social accounts, since there is really nothing to save. The social providers implement SSO themselves.
@samtstern Yes Smart Lock works fine with Email/Password. If you don't save any credentials for social accounts how the application know if the user is already registered? And why is that error being logged in the logcat? Also, Why is this stated in the docs?
By default, FirebaseUI uses Smart Lock for Passwords to store the user's credentials and automatically sign users into your app on subsequent attempts.
https://github.com/firebase/FirebaseUI-Android/blob/master/auth/README.md?authuser=1#smart-lock
@HelaGone you're right that we should definitely keep that error from being logged if it's intended behavior!
I will have to go find the old discussion, but I believe we decided that for all account types besides Phone or Email, SmartLock was not a great user experience. The prompt dialog has no way of indicating which social provider it has saved, and in the end we can't guarantee that sign in will succeed we can only launch the social flow.
@SUPERCILEX do you remember any of these discussions?
Are you telling me that I should not care about that error and disable Smart Lock for Passwords as described in the docs with setIsSmartLockEnabled(false)
?
@HelaGone just to be clear: when you try to sign in with Google/Facebook does it succeed with errors in the logs or does it fail completely?
@samtstern It succeed with the mentioned error, and the user is signed in. I can get the current user data (Name, Photo, Uid, Etc)
@HelaGone ok in that case I would say you should keep SmartLock enabled and ignore the logs for now, with the understanding that SmartLock is only working for Email/Phone accounts right now. We will try to address this in a future bugfix release. Thank you for all the information!
Here is more Log Juice in case you need it:
2019-05-02 11:46:04.604 1989-2091/com.iphoideas.android.myorganization D/FA: Connected to remote service
2019-05-02 11:46:04.616 1989-1989/com.iphoideas.android.myorganization W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzam@d61911b
2019-05-02 11:46:04.618 1989-1989/com.iphoideas.android.myorganization E/Twitter: Authorize not in progress
2019-05-02 11:46:04.643 1989-1989/com.iphoideas.android.myorganization W/PropertyValuesHolder: Method set() with type float not found on target class class me.zhanghai.android.materialprogressbar.IndeterminateHorizontalProgressDrawable$RectTransformX
2019-05-02 11:46:05.371 1989-2003/com.iphoideas.android.myorganization D/FirebaseAuth: Notifying id token listeners about user ( L5NyrhtJiChgc4WL9XJ2M2M6njN2 ).
2019-05-02 11:46:05.371 1989-2003/com.iphoideas.android.myorganization D/FirebaseAuth: Notifying auth state listeners about user ( L5NyrhtJiChgc4WL9XJ2M2M6njN2 ).
2019-05-02 11:46:05.379 1989-1989/com.iphoideas.android.myorganization D/FirebaseApp: Notifying auth state listeners.
2019-05-02 11:46:05.380 1989-1989/com.iphoideas.android.myorganization D/FirebaseApp: Notified 0 auth state listeners.
2019-05-02 11:46:05.543 1989-1989/com.iphoideas.android.myorganization D/CredentialSaveActivity: Launching save operation.
2019-05-02 11:46:05.549 1989-1989/com.iphoideas.android.myorganization E/AuthUI: A sign-in error occurred.
com.firebase.ui.auth.FirebaseUiException: Failed to build credential.
at com.firebase.ui.auth.viewmodel.smartlock.SmartLockHandler.saveCredentials(SmartLockHandler.java:76)
at com.firebase.ui.auth.ui.credentials.CredentialSaveActivity.onCreate(CredentialSaveActivity.java:67)
at android.app.Activity.performCreate(Activity.java:7032)
at android.app.Activity.performCreate(Activity.java:7023)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1236)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2814)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2943)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1630)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6626)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
2019-05-02 11:46:05.620 1989-1989/com.iphoideas.android.myorganization E/Twitter: Authorize not in progress
2019-05-02 11:46:05.690 1989-1989/com.iphoideas.android.myorganization D/MainActivity: User Logged >>>> Stephen Jane
@samtstern the discussion was here: https://github.com/firebase/FirebaseUI-Android/issues/1154. From what I remember, we try saving all credentials so that they're available to use for us and the app developer. When the user tries signing in again, we only show easy to use IDPs (only Google right now). So yeah, the above looks like a bug.
Ok digging into this I believe this happens when email is null, which can happen due to #1621 but a fix for that has already been implemented.
I was able to build credentials for Google and Facebook accounts in my testing, I will add some extra logging around this case but for now I believe that's all I can do (in addition to other fixes).
The fix for this issue has been released in version 6.2.1
Hello everyone! I don't understand why Firebase UI isn't capable to build and store the user's credentials. Here's the problem:
Step 2: Describe your environment
Step 3: Describe the problem:
The problem is that Firebase UI is not building the appropriate credentials for the signed in user and therefore each time the user wants to login in the application it is prompted to follow along the whole process of signing in instead of just logging the user with its credentials
Steps to reproduce:
E/AuthUI: A sign-in error occurred. com.firebase.ui.auth.FirebaseUiException: Failed to build credential.
I've already checked that my application is not listed under "Never Save" option in the Smart Lock for Passwords in the device.
Observed Results:
Expected Results:
The expected result is the build and save of the user's credentials in the Smart Lock for Passwords. Which is not happening.
Relevant Code:
This is called when te user clicks on the login button
And this is called when the result is received