Firebase: custom auth domain verification failed - firebase

I have a firebase project setup, and a domain, matoitechnology.com. Im trying to customize my domain through google domains so the emails dont go in the spam folder, but the dns authentication failed.
I blurred out everything, but I just copy and pasted the values given.
Firebase auth details
google domains:
domains screenshot
The one thing that I feel i may be doing wrong is that firebase seems to have two separate text records, but google domains will only allow me to create one record with multiple values. If i try to add another text record, it will try to replace my current text record. Any ideas?

Google Domains seems to append your domain automatically to whatever record you paste in. So if you paste firebase1._domainkey.yourdomain.com into the record in Google Domains (as instructed by directions in Firebase), your actual value will likely be firebase1._domainkey.yourdomain.com.yourdomain.com. It's easy to overlook, and was the issue for me.

Related

How to add a subdomain using Firebase and Namecheap?

I am trying to add a subdomain for my firebase app but it is not working. I've looked at Firebase site's Subdomain setup and this other SO post How do I make a custom subdomain on Firebase? but they didn't really help me.
I have a firebase app that is currently running: myawesomesite.com. I have another firebase app that I want to create the subdomain for awesome.myawesomesite.com.
I own the domain name myawesomesite.com via Namecheap. myawesomesite.com has been up for over a year.
Here is what it looks like on Firebase Hosting for the awesome app:
It has been showing "Needs setup" for the past 4 days.
Went I went through "Add custom domain", Firebase verified myawesomesite.com domain. Then I told Firebase that I wanted awesome.myawesomesite.com. Firebase then gave me two A Record values:
I also noticed that the A Record values for my subdomain request (awesome.myawesomesite.com), 123.456.7.890, are exactly the same A Record values for my domain myawesomesite.com.
This is what it looks like on my Namecheap dashboard:
I am pretty sure I did something wrong because Firebase give the same A Record values for both my domain (myawesomesite.com) and my subdomain (awesome.myawesomesite.com). I expected them to have different values. But Firebase gave me those values when I'm on my awesome project requesting for "Add custom domain". It has been 4 days and awesome.myawesomesite.com hasn't been active yet.
How can I correctly add a subdomain awesome.myawesomesite.com using namecheap and firebase hosting? Is this even possible on Firebase in 2021?
I had the same task at hand and proceeded as follows:
In Firebase console, click to add a new custom domain to your hosting project and enter the subdomain with main-domain. E.g. 'sub.domain.com'.
Copy the value ("google-site-verification=something").
In Namecheap, go to the advanced DNS menu and add a new TXT record.
Host*: #
Value: google-site-verification=something
Save and wait for 5~15 minutes.
Back in Firebase Hosting, click to verify your domain. (If not ready yet, try again until verified).
After this, Firebase gave me one A record. Not two as normally stated in the docs! Might be because it is the year 2023, or because it is a subdomain, or both.
Enter this record in Namecheap.
Host: the subdomain name you want to use (e.g. sub)
Value: the address Firebase gave you (e.g. 111.222.333.444).
I did not(!) delete any other A or AAAA record as stated in the docs or the Firebase console.
Save and wait for 1~24 hours. Your subdomain should now be verified and activated.
*I usually saw docs and help desk entries that state, that for a subdomain, the TXT record's Host value should include the subdomain (e.g. only "sub", or "sub.domain.com", etc.), but that didn't work for me, so I changed it to "#" and got verified shortly after.

Firebase dynamic link with query parameters

I've been looking at replacing all the links in the firebase password reset and welcome emails with something more custom, so it doesn't look terrible for users (so moving from https://some-app-123f.firebaseapp.com to link.some-app.com).
I thought that the best way to do this might be to use the firebase dynamic links, so I set up link.some-app.com in there. All good so far.
I generated a new dynamic link directly in the web interface. This is basically going to be used for everyone, or that is my hope. Let's call that link link.some-app.com/email-link. I have then set this up to point to https://some-app-123f.firebaseapp.com/__/auth/action. Going to the first takes me to the second, all good so far. The links just open the web, not apps, and no interstitial page.
I can replace the "Action URL" in the email template with link.some-app.com/email-link. When I email a password reset, I get a link that looks like this: https://link.some-app.com/email-link?mode=resetPassword&oobCode=[hash]&apiKey=[key]&lang=en
However, when I click on this link in debug mode (adding d=1 to the end), I get a bunch of errors:
The format of parameter (mode) is not whitelisted for this domain.
So I thought that I could solve this by using the whitelisting feature on the link domain in the firebase console, so I've tried a bunch of different options, but these are the two most permissive (to cover both domain bases, though I am pretty sure I need to be whitelisting the target domain i.e. firebase)
^https://some-app-123f.firebaseapp.com.*$
^https://link.some-app.com/email-link.*$
Am I completely missing something? Is this something that just isn't possible because it is redirecting back to firebase?
tl;dr: I'm trying to create an effectively serverless redirect link to the password reset functionality in firebase using a prettier url than firebase gives you out of the box
Your URL patterns are incorrect. You haven't escaped . Your pattern should be
^https://some-app-123f\.firebaseapp\.com/.*$
You don't need to add the second URL to whitelist.
If an improper program from the Dynamic Links prevents redirection to the sites that are beyond your control then you need to whitelist the URLs where the Dynamic Links can redirect to. For more information regarding whitelisting URLs please visit the link enter here .

Where to find DNS A records information in Firebase Hosting for a previously connected custom domain?

When you add a custom domain in Firebae Hosting, at the end of the process you see two DNS A records that you should add to your DNS configuration.
https://firebase.google.com/docs/hosting/custom-domain#go-live
QUESTION
But after you're done with the process of adding the new custom domain, where in the Firebase Console can you find the information about those DNS A records again?
I didn't find it in the Firebase Hosting section nor in my Project Settings.
I haven't seen anything within the Firebase console that shows the record information, but the A records are outlined in their per-provider docs lower in the documentation you provided:
https://firebase.google.com/docs/hosting/custom-domain#dns-records-cloudfare
I just found out that if the DNS A records have already been detected by Firebase, they will no longer be accessible from the Firebase Console.
But if the records haven't been detected by Firebase yet, you be able to see them by clicking on your custom domain on your console's Firebase Hosting section. It will be marked with "View Setup" or something like that (don't remember the exact phrase).
If it's marked as "pending", it's because the records have already been detected and it's waiting for propagation across the DNS network.
It it's marked as "conected", it's because it's already up an running.

Single sign on Google

How does the Google single sign on works (OR any website's SSO)?
For example, once I login to the Gmail, it lets me see "My places" on Google Maps without signing in again? Same with Yahoo mail and Yahoo notepad.
I am guessing this checking is done locally within the browser. But any more details would be appreciated.
It is done with a cookie, that is accessible to all sub-sites on google, and it contains identification numbers. Then the sub-site queries the account server, gives the cookie, and the account server will return the user.
Actual implementation details may vary (as I am not a Google engineer), but I think you want to know how to do it, not what google does.

Google Analytics API: Include profile domain in Profile Feed

Using the Google Analytics API I would like to display the domain associated with each GA profile. Is this possible or is there another way to do it? I have been unable to find any documentation for the domain.
http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html#accountResponse
http://code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html#profileFeed
I can't use profileName because depending on how the user has their GA account setup, it may just be a string and not a domain.
One thing you might do is perform a query using ga:hostnames as the dimension and either ga:visits or ga:pageviews as metrics. This will yield a chart of the host name (what is in the browser address bar) to reach that site. Sort of a hack in a way. Technically you can use a single GA Tracking code on multiple sites. So there is no "Official" domain name associated with a profile.
Unfortunately, I don't think it's possible with the current API. Furthermore, you can't explicitly depend upon the domain they enter as the only domain the profile is tracking since there is further customization that allows the user to specify if they want to track subdomains and/or top-level domains. I believe your only option is to ask the user the same information Google asks the user and help the user understand they will have to manually keep two lists in sync due to limitations of the Google API.

Resources