Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change display name for firebase google auth provider

I am trying to display the name of my website on AuthO popups. No issues with Facebook, Twitter or GitHub auth. But Google's popup keep showing 'Sign in to continue to projectName.firebase.com' Instead of 'example.com'. I mean it shows firebase's default domain instead of custom one.

Image 1

Even if I change display name to some custom name in console.developers.google.com.

Image 2

like image 521
Vartan Israelyan Avatar asked Dec 22 '17 18:12

Vartan Israelyan


People also ask

How do I change my Firebase authentication username?

You create a new user in your Firebase project by calling the createUserWithEmailAndPassword method or by signing in a user for the first time using a federated identity provider, such as Google Sign-In or Facebook Login.

How do I customize my Firebase verification email?

To customize your Firebase project's email action handler, you must create and host a web page that uses the Firebase JavaScript SDK to verify the request's validity and complete the request. Then, you must customize your Firebase project's email templates to link to your custom action handler.

What is provider ID in Firebase?

providerId is always 'firebase' #1768.


1 Answers

In the newest version of Firebase user guide they explain how to fix this, by pointing authDomain initialization property to your domain, and making a few other preparations: https://firebase.google.com/docs/auth/web/google-signin#customizing-the-redirect-domain-for-google-sign-in

  1. Create a CNAME record for your custom domain that points to your project's subdomain on firebaseapp.com:
    auth.custom.domain.com CNAME my-app-12345.firebaseapp.com
  2. Add your custom domain to the list of authorized domains in the Firebase console: auth.custom.domain.com.
  3. In the Google developer console or OAuth setup page, whitelist the URL of the redirect page, which will be accessible on your custom domain: https://auth.custom.domain.com/__/auth/handler.
  4. When you initialize the JavaScript library, specify your custom domain with the authDomain field

Update: one important detail that's missing from the instructions is that the custom auth domain must be configured for Firebase Hosting (i.e. add it to the list of custom domains for Hosting on the Firebase Console). Otherwise you will get a certificate mismatch error as @AmritanshSinghal correctly points out.

like image 154
J. Williams Avatar answered Sep 19 '22 08:09

J. Williams