Verify Firebase domain for Sign in With Apple

I'm trying to use Sign in With Apple as an option for firebase authentication. When I follow the steps to set it up, I get to the part where I have to verify the domain and email for communication. I got the email part setup, but I can't find a way to verify the domain. Here is the domain firebase gave me "project-name".firebaseapp.com. I downloaded the txt file, but from there I can't figure out how to verify it. I went to the link Apple gave but nothing was there. Where and how do I verify the domain?

Replies

Hi,

You didn't say what platform you're using firebase with, but if it's web/JS then you have to set up firebase hosting if you're not already using it - then you can put the txt file in a directory (.well-known) inside your 'public' folder - full instructions are here: https://firebase.google.com/docs/auth/web/apple#configure-sign-in-with-apple


Unfortunately, I've got that far, but when I click 'verify' the connection immediately closes down and it fails. I've found online that it's supposed to work if you use the firebase domain without the 'https://' in the domain field and with the 'https://' in the return URL field (firebase gives you the address 'https://YOUR_DOMAIN_NAME.firebaseapp.com/__/auth/handler' to put in that field). So...I hope you have better luck than me!! If it works for you, do let me know - or if you find any tips!!! :-)

  • You have to add the text file to a folder “.well-known” you’d create inside the public folder of your web app and publish. Then you’d click verify for Apple look for such via path they provided to you in order to pass that part.

Add a Comment

I have done all these things, and I actually verified the domain successfully before in December, but for some reason it is not working for me now either.


In another thread (https://forums.developer.apple.com/thread/122124) there are other things to check (redirects and SSL ciphers and what-not) but none of that is under our control with firebase hosting, and either way I've verified by direct request inspection (HTTP response codes and headers etc) that it's a plain 200 response with the file as expected from the firebase hosting domain


[Edit / update]: I have requested support from the firebase team. I'm a react-native-firebase maintainer so hopefully they help me and we can figure it out :-)


[Second edit / update]: it occurred to me that I had successfully verified a different iOS app but it was this same firebase backend (so the same domain and handler URLs) and sure enough I still had that service ID verified / connected, which is not valid because you can only have a domain linked to one at a time. So I deleted those old services with the verified domains and re-tried, and it still failed. At this point it might be transient - failing only because I deleted the associates so recently - or it might be persistent. But there is at least one valid reason why my validation was failing. Hopefully this resolves at least and I am able to re-verify the domain under the new iOS app as I was able to do in December


Final update: I successfully verified the domain. You need to make sure it is not already associated somewhere else (remove it if needed). Configure the domain as if you were going to verify it then make sure it's saved. Then go back in, verify the domain is correct and download / re-push the file to public hosting, and verify. It should work. This is with the default "yourapp".firebaseapp.com domains and auth handlers.