You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For issues or feature requests related to the code in this repository file a GitHub issue.
Step 2: Describe your environment
Android device: SM-S918B/DS
Android OS version: 14
Google Play Services version: 24.26.32
Firebase/Play Services SDK version: 32.8.1
FirebaseUI version: 8.0.0
(Also tried multiple Firebase BOM versions between 28.0.0-32.8.1, tried FirebaseUI 7.2.2, and using an API 34 Play Services enabled emulator, same result)
Step 3: Describe the problem:
Getting com.firebase.ui.auth.FirebaseUiException: Developer error after going through authentication with Microsoft auth provider.
The error comes from ProviderUtils.java:229.
NOTE: My assumption is that this usecase happens, since the email I'm using [email protected] is already authenticated with Google as a provider.
The web AuthUI library handles this by asking giving the user the option to link the accounts. Is this what we don't have on Android, and if so, how do we handle this manually?
The setup in the firebase console, and the mobile client should be good, based on the facts that:
Google authentication works on mobile as expected (suggesting the correct config is used)
Microsoft authentication works for our webapp using the same project (suggesting the Firebase Console setup is correct)
Observed Results:
onActivityResult is called after the Custom Google Chrome tab is closed with resultCode=0, and info in data.extras: IdpResponse{mUser=null, mToken='null', mSecret='null', mIsNewUser='false', mException=com.firebase.ui.auth.FirebaseUiException: Developer error, mPendingCredential=null}
Expected Results:
onActivityResult called with a successful resultCode=-1, authentication succeeds.
Relevant Code:
val intent = when (providerType) {
LoginProviderType.GOOGLE -> viewModel.getGoogleLoginIntent(email)
LoginProviderType.MICROSOFT -> viewModel.getMicrosoftLoginIntent(email)
else -> return@observeFreshly
}
startActivityForResult(intent, REQUEST_CODE)
-----
override fun getMicrosoftLoginIntent(email: String?): Intent {
val providerBuilder = AuthUI.IdpConfig.MicrosoftBuilder()
if (!email.isNullOrBlank()) {
providerBuilder.setCustomParameters(
mapOf("login_hint" to email)
)
}
return AuthUI.getInstance()
.createSignInIntentBuilder()
.setLogo(R.drawable.logo)
.setTheme(R.style.MyStyle)
.setAvailableProviders(arrayListOf(providerBuilder.build()))
.setIsSmartLockEnabled(false)
.build()
}
----
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE && resultCode == Activity.RESULT_OK) {
viewModel.onLoginFlowDone()
}
}
The text was updated successfully, but these errors were encountered:
I've figured out what is happening, but not closing the issue to see if there is any workaround for this usecase.
Since our application requires us to use to use email+password login with a given tenant, and any other authentication methods without a tenant, we can't use the complete UI solution this library provides.
Our workaround was to launch dedicated intents, one per auth provider.
This caused the error, since when the library tries to link two accounts from different providers, both providers needs to be set as allowedProviders, which is not the case our aforementioned setup.
Step 1: Are you in the right place?
Step 2: Describe your environment
(Also tried multiple Firebase BOM versions between 28.0.0-32.8.1, tried FirebaseUI 7.2.2, and using an API 34 Play Services enabled emulator, same result)
Step 3: Describe the problem:
Getting
com.firebase.ui.auth.FirebaseUiException: Developer error
after going through authentication with Microsoft auth provider.The error comes from ProviderUtils.java:229.
NOTE: My assumption is that this usecase happens, since the email I'm using [email protected] is already authenticated with Google as a provider.
The web AuthUI library handles this by asking giving the user the option to link the accounts. Is this what we don't have on Android, and if so, how do we handle this manually?
The setup in the firebase console, and the mobile client should be good, based on the facts that:
Observed Results:
onActivityResult
is called after the Custom Google Chrome tab is closed withresultCode=0
, and info in data.extras:IdpResponse{mUser=null, mToken='null', mSecret='null', mIsNewUser='false', mException=com.firebase.ui.auth.FirebaseUiException: Developer error, mPendingCredential=null}
Expected Results:
onActivityResult
called with a successfulresultCode=-1
, authentication succeeds.Relevant Code:
The text was updated successfully, but these errors were encountered: