Skip to content
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

AuthUI.getInstance().createSignInIntentBuilder() causing "An internal error has occured. [ Backend Error ]" #212

Closed
kermitdefroghere opened this issue Jul 14, 2016 · 20 comments

Comments

@kermitdefroghere
Copy link

kermitdefroghere commented Jul 14, 2016

Step 2: Describe your environment

  • Android device: Nexus 5__and Nexus 7___
  • Android OS version: 6.0.1___
  • Google Play Services version: _____
    classpath 'com.google.gms:google-services:3.0.0'
  • Firebase/Play Services SDK version: _____
    compile 'com.google.firebase:firebase-storage:9.2.0'
  • FirebaseUI version: ____
    compile 'com.firebaseui:firebase-ui:0.4.2'

Step 3: Describe the problem:

FirebaseUI crashes with error below when attempting to login with code below.
Error is reported silently in Android monitor. App simply reports 'loading' for a number of seconds and goes to blank screen.
onActivityResult is never called.

Same result with either Smartlock or manually entered email/password.

Nexus 5x with Android N works fine.
Problem only exists with my Nexus 5 and Nexus 7.

Observed Results:

07-14 16:43:27.474 28980-28980/ca.tentensolutions.physiotherapy W/AcquireEmailHelper: Error fetching providers for email
com.google.firebase.FirebaseException: An internal error has occured. [ Backend Error ]
at com.google.android.gms.internal.zzafg.zzes(Unknown Source)
at com.google.android.gms.internal.zzafd$zzg.zza(Unknown Source)
at com.google.android.gms.internal.zzafo.zzet(Unknown Source)
at com.google.android.gms.internal.zzafo$zza.onFailure(Unknown Source)
at com.google.android.gms.internal.zzafj$zza.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)

Relevant Code:

                startActivityForResult(
                        // Get an instance of AuthUI based on the default app
                        AuthUI.getInstance().createSignInIntentBuilder().build(),
                        RC_SIGN_IN);
@kermitdefroghere
Copy link
Author

Is it possible to have an update on this error?
This still occurs with Firebase UI 4.3.

Are there any work arounds?

@samtstern
Copy link
Contributor

@kermitdefroghere are you using the same account (same email address) on each device? I'd like to see if this is an account-specific issue or a device/os/play services specific issue.

@kermitdefroghere
Copy link
Author

kermitdefroghere commented Aug 1, 2016

It occurs for different accounts/email addresses on different devices.
My domain (for testing) is managed by google and there are different results if Google sign-in method is enabled or not.

As of this morning, Smart lock is not allowing me to login at all???
StartActivityForResult reveals a 'Google Smart Lock' notification box in bottom left,... and screen just goes blank. OnActivityResult is never triggered.
At this point, I'm not even presented with the option to select signin with Google or email.

My feeling is that the combination of Smartlock and a Google managed domain is causing the problem.

@kermitdefroghere
Copy link
Author

kermitdefroghere commented Aug 1, 2016

I can confirm that disabling smartlock and auto signin at passwords.google.com is a temporary work around for my nexus devices and Pixel C.
However, it is not a workaround for running my android app on Chromebook Flip.
Upon selecting 'Sign in with Google' from the FirebaseUI login screen and choosing the desired account, it simply returns back to the FirebaseUI login screen. This process can be repeated indefinitely across different accounts... so no change there.

@alfongj alfongj added the auth label Aug 2, 2016
@samtstern
Copy link
Contributor

samtstern commented Aug 23, 2016

@kermitdefroghere version 0.5.1 has a new option on the intent builder to disable SmartLock for Passwords. Could you try that and see if it solves your problem?

@kermitdefroghere
Copy link
Author

kermitdefroghere commented Aug 26, 2016

Hi Sam,

Unfortunately, this doesn't fix the problem on my Chromebook (Asus Flip).

I have both Google and email authentication enabled.
When trying to 'Sign in with Google', I'm presented with my google account to select and then I'm brought right back to the
firebaseUI screen (below).

When trying to 'Sign in with Email', I enter my google email after which I'm informed that 'You already have an
account. Sign in with Google to continue'. After I click the 'sign in'
button, I receive the Toast message "Error signing in" and I'm back at the
firebase UI screen (below).

Since I'm running this on the Asus Flip, I can't run in debug mode or
capture any logs.

If there's any other information you need, please let me know.

Derek

p.s. Here's the actual method call with setIsSmartLockEnabled = false

        startActivityForResult(
                AuthUI.getInstance()
                        .createSignInIntentBuilder()
                        .setProviders(
                                AuthUI.EMAIL_PROVIDER,
                                AuthUI.GOOGLE_PROVIDER)
                        .setTheme(R.style.AppTheme)
                        .setLogo(R.mipmap.ic_launcher)
                        .setIsSmartLockEnabled(false)
                        .build(),
                RC_SIGN_IN);

[image: Inline image 1]

On Aug 23, 2016 4:15 PM, "Sam Stern" notifications@github.com wrote:

@kermitdefroghere https://github.com/kermitdefroghere version 0.5.1 has
a new option on the intent builder to disable SmartLock for Passwords.
Could you try that and see if it solved your problem>


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#212 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQPs6T0RBCmtkIpiDTB-9aOzaWMe-vKlks5qi2LegaJpZM4JM4-7
.

@samtstern
Copy link
Contributor

@kermitdefroghere at this point I am not sure how to proceed without some debug logs from the Chromebook, otherwise I'd just be guessing (and clearly my guessing above didn't work).

I will leave this issue open in the hopes that someone else with a Chromebook has some insight.

@kermitdefroghere
Copy link
Author

Do you have instructions for how I can provide the debug logs from the
Chromebook?
I'd be more than happy to provide that.

On Aug 30, 2016 3:08 PM, "Sam Stern" notifications@github.com wrote:

@kermitdefroghere https://github.com/kermitdefroghere at this point I
am not sure how to proceed without some debug logs from the Chromebook,
otherwise I'd just be guessing (and clearly my guessing above didn't work).

I will leave this issue open in the hopes that someone else with a
Chromebook has some insight.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#212 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQPs6e-LzidNwYVke1JEB3E3xY1uEtwRks5qlGcUgaJpZM4JM4-7
.

@samtstern samtstern added this to the 1.0.0 milestone Sep 6, 2016
@kermitdefroghere
Copy link
Author

kermitdefroghere commented Sep 10, 2016

Quick update that FirebaseUI 0.5.3 doesn't fix anything.
Repeat: Apps that use FirebaseUI/auth do not currently work on Chromebooks because google users can't login!!!

Isn't this a big deal?

(To be entirely clear, it's Google managed domains that don't work. 'signing in with email' for a non google managed domain does work)

@samtstern
Copy link
Contributor

samtstern commented Sep 12, 2016

@kermitdefroghere thanks for checking 0.5.3 and following up. I agree this is not a good experience, but we can only guess what's causing it without proper debug logs from a Chromebook. If you do figure out how to capture those, let me know.

@kermitdefroghere
Copy link
Author

kermitdefroghere commented Sep 24, 2016

For what it's worth, I'm seeing that other Android Apps struggle logging in on Chromebooks as well.
Feedly for example simply loops when trying to 'Sign in with Google' as well.

Should this bug be reported elsewhere?
If so, where?

@kermitdefroghere
Copy link
Author

I have more info on this problem.
Simply no return to OnActivity result from signed apk. When signing in with google from any of my test device (Pixel C, Nexus 5x, Asus Chromebook flip).

Have to use sign in with email.

Will be forced to disable 'sign in with google' option until this is resolved.

@samtstern
Copy link
Contributor

@kermitdefroghere have you registered your signed version of the app in the Firebase console? The fact that your app only fails with a different signing configuration (and specifically with Google Sign In) leads me to believe that this is a SHA1 configuration issue.

I have this function in my .bashrc so I can check the SHA1 of an APK, which you can use on your release APK to make sure the SHA1 matches one of the ones you have registered in the Firebase console:

# Usage
# apk_signature my-apk-file.apk
function apk_signature() {
  TMP_DIR=$(mktemp -d)
  unzip $1 -d $TMP_DIR > /dev/null
  keytool -printcert -file $TMP_DIR/META-INF/*.RSA
  rm -r $TMP_DIR
}

@kermitdefroghere
Copy link
Author

You're likely on to something.

I have one SHA1 certificate fingerprint setup,... and seeing the helptext
on it, I see a reference to
https://developers.google.com/android/guides/client-auth
https://developers.google.com/android/guides/client-auth'for information
on using keytool to get the SHA1 has of your signing certificate".

I'm not familiar with .bashrc but I'll look into this and get back to you.

Thanks for pointing this out Sam.

On Mon, Oct 3, 2016 at 12:38 PM, Sam Stern notifications@github.com wrote:

@kermitdefroghere https://github.com/kermitdefroghere have you
registered your signed version of the app in the Firebase console? The fact
that your app only fails with a different signing configuration (and
specifically with Google Sign In) leads me to believe that this is a SHA1
configuration issue.

I have this function in my .bashrc so I can check the SHA1 of an APK,
which you can use on your release APK to make sure the SHA1 matches one of
the ones you have registered in the Firebase console:

Usage# apk_signature my-apk-file.apkfunction apk_signature() {

TMP_DIR=$(mktemp -d)
unzip $1 -d $TMP_DIR > /dev/null
keytool -printcert -file $TMP_DIR/META-INF/*.RSA
rm -r $TMP_DIR
}


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#212 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQPs6abtJXfcssvTwc0ZaR5TScnpzMRGks5qwT2MgaJpZM4JM4-7
.

@SUPERCILEX
Copy link
Collaborator

You can also get your sha1 keys from Android Studio: http://stackoverflow.com/a/34223470/4548500

@kermitdefroghere
Copy link
Author

Ok. I can confirm that adding the SHA1 for the signed apk has fixed my Google Signin issue.
Thanks for the suggestion Sam.

For other newbies in the future, it would likely be helpful if activityResult was triggered with with error resultcode instead of not being triggered at all.

@samtstern
Copy link
Contributor

@SUPERCILEX thanks for showing me the fantastic signingReport task. I think I will recommend ./gradlew :app:signingReport as the proper way to do this from now on.

@SUPERCILEX
Copy link
Collaborator

@samtstern Your welcome!

@amandle
Copy link
Contributor

amandle commented Oct 22, 2016

#371 should make it clearer that it was Google Sign In failing. We currently can't tell if it failed because of a config error, or if it was canceled by the user, so we have to stay on the AuthMethodPickerActivity and can't finish with an error result.

@yassermohammad
Copy link

Hey all, i fixed it with update Google Play Service to last version...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Version 1.0.0
Implemented
Development

No branches or pull requests

6 participants