Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Hosting: Preventing unauthorized access to URL

I am trying to secure some pages behind firebase auth -however every time I try open them - I seem to be able to browse to them. Even when I follow the documentation.

I can't seem to find anyway to restrict the page to be accessible only to authorized users.

Any idea how best to approach this?

Edit: Looks like its not supported directly without building a lot of custom code. It would be brilliant if they can support a simple htaccess file or similar. - Here is a link to post feature request https://firebase.google.com/support/contact/bugs-features/

like image 583
UKDataGeek Avatar asked Dec 15 '17 17:12

UKDataGeek


People also ask

Can I change Firebase Hosting URL?

You can't change your domain, but you can change the host! You can make as many sites as you want.

Does Firebase handle authentication?

Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more.

How much traffic can Firebase handle?

The limit you're referring to is the limit for the number of concurrently connected users to Firebase Realtime Database on the free Spark plan. Once you upgrade to a payment plan, your project will allow 200,000 simultaneously connected users.

Is Firebase realtime database secure?

Firebase Security Rules provide robust, completely customizable protection for your data in Cloud Firestore, Realtime Database, and Cloud Storage. You can easily get started with Rules following the steps in this guide, securing your data and protecting your app from malicious users.


1 Answers

All static content (HTML, CSS, JS, and other files) published to Firebase Hosting is publicly accessible if you know the URL. There are no authentication controls you can easily configure to change this behavior.

If you need to protect content, you could set up some code via Cloud Functions that checks the user's authentication and serves the content based on its decision.

like image 109
Doug Stevenson Avatar answered Nov 01 '22 04:11

Doug Stevenson