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.
Even if I change display name to some custom name in console.developers.google.com
.
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.
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.
providerId is always 'firebase' #1768.
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
- 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
- Add your custom domain to the list of authorized domains in the Firebase console:
auth.custom.domain.com
.- 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.
- 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With