Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ToS and Privacy policy links in sign-in with Google not working

I have implemented the firebase authentication UI including the email and Google as providers. I have also included the ToS and privacy policy links as follows:

List<AuthUI.IdpConfig> providers = Arrays.asList(
                    new AuthUI.IdpConfig.EmailBuilder().build(),
                    new AuthUI.IdpConfig.GoogleBuilder().build());


            // Create and launch sign-in intent
            startActivityForResult(
                    AuthUI.getInstance()
                            .createSignInIntentBuilder()
                            .setTosAndPrivacyPolicyUrls(
                                    "https://test.com/terms-and-conditions/",
                                    "https://test.com/privacy-policy/")
                            .setLogo(getApp().isDemoApplication() ? R.drawable.log1 : R.drawable.log2)
                            .setTheme(R.style.LoginTheme)
                            .setAvailableProviders(providers)
                            .build(),
                    RC_SIGN_IN);

The links work perfectly fine in the first page but when I choose the Google option for authentication, then the links in the popup do not work and keep showing the toast saying "No browser found to open this link."

I have followed the instructions to reset my apps configurations, also reset my phone(s) and changed my default browser to chrome. But none of them solved the issue. I have tested this on two android phones; Sony Xperia with android 10 and Samsung Galaxy s8 with android 9.

Is there any settings I missed in my AuthUI or in my app?

like image 685
msc87 Avatar asked Oct 23 '25 17:10

msc87


2 Answers

I had the exact same problem, you have to add the Application Privacy Policy AND the Application Terms of Service links into the Google Cloud console.

They can be added by visiting the following URL: [Project ID is [PROJECT-ID], and authorise the domain used in those links.]

https://console.cloud.google.com/apis/credentials/consent/edit?project=[PROJECT-ID]

like image 88
AndersF Avatar answered Oct 26 '25 06:10

AndersF


as I see your are using an old version.

You can follow this guide to use the last version without "startActivityForResult". https://firebase.google.com/docs/auth/android/firebaseui

I had the same problem when I used the URL´s without "https://". Is the code you posted an example or is the real one?

like image 36
Guille Avatar answered Oct 26 '25 07:10

Guille



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!