Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show our custom domain on Google sign-in?

We have a web app with Firebase, and we already connected our custom domain, and can access the website with www.example.com.

Problem: when user is sign in user Gmail, he see this on Google's page :

"Sign in to project-60017.firebaseapp.com"

instead of

Sign in to example.com

Even that this app is already connected and working with example.com.

We initializing the app with :

              authDomain: "project-60017.firebaseapp.com",
              databaseURL: "https://project-60017.firebaseio.com",
              projectId: "project-60017",
              storageBucket: "project-60017.appspot.com",
              messagingSenderId: "75892xxxxxx"

If I try to change these URLs to example.com nothing will work anymore.

How to make users that sign in to see example.com (our own domain) ?

EDIT:

If i change this : authDomain: "example.com", in the project setup, i will get a redirect error when signin :

The redirect uri in the request .../auth/handler does not match the ones autorized for the OAtuh
like image 275
hkrlys Avatar asked Oct 22 '25 02:10

hkrlys


1 Answers

To anyone who is trying, I just changed Authorized redirect URIs in the Google Cloud Console.

I have added this record :

https://example.com/__/auth/handler

When you add it, don't click save, first click Enter, then save. (otherwise it won't be saved and that was my problem).

Then in the Firebase app itself - you have to set:

authDomain: "example.com",

and then you see your domain on log in.

like image 100
hkrlys Avatar answered Oct 24 '25 14:10

hkrlys



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!