A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/firebase/FirebaseUI-Android/issues/1762 below:

Currently not possible to use `setAllowNewAccounts(false)` with email/link authentication · Issue #1762 · firebase/FirebaseUI-Android · GitHub

It's currently not possible to create a user with the firebase admin sdk (or any other way outside of firebase UI) and have that user use email/link authentication. It seems that if you want to use email/link, you are forced to enable client registration (setAllowNewAccounts(true)), which is not always desirable.

I traced the code and the issue is that an externally created user always is created with a password provider id. This causes issues in com.firebase.ui.auth.util.data.ProviderUtils#fetchSortedProviders, which ends up throwing a developer error.

This is related to #1735 but there it was mentioned something slightly different: once you enable email/link, previous users with email/password won't be able to log in, meaning to use email/link, ALL users must use it, which looks like a design decision that requires a new feature to be improved. The situation here looks to me more like a bug: a completely new user that has never logged in cannot login at all, even if it is the first user in a blank auth db or all the users were created after enabling email/link auth. Also, the fact that the application accepts an invalid configuration (setAllowNewAccounts(false) with .enableEmailLinkSignIn(), which will never work together) also makes it look more like a corner-case bug

Steps to reproduce
List<AuthUI.IdpConfig> providers = getAvailableProviders();
Intent loginIntent = AuthUI.getInstance()
                .createSignInIntentBuilder()
                .setAvailableProviders(providers)
                .build();
startActivityForResult(loginIntent, LOG_IN_REQUEST_CODE);

private List<AuthUI.IdpConfig> getAvailableProviders() {
        ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder()
                .setAndroidPackageName(BuildConfig.APPLICATION_ID, true, null)
                .setIOSBundleId(iOsBundleId)
                .setHandleCodeInApp(true)
                .setUrl("https://foo")
                .build();

        return Collections.singletonList(
                new EmailBuilder()
                        .setAllowNewAccounts(false)
                        .enableEmailLinkSignIn()
                        .setActionCodeSettings(actionCodeSettings)
                        .build());

    }

Finally, all this worked fine if using pure firebase-auth: you can create a user externally and log it in using email/link


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4