Is it possible to restrict access to a resource (i.e. index.html) depending on whether the user is logged in or not? Maybe something like .htaccess?
Firebase Hosting is production-grade web content hosting for developers. With a single command, you can quickly deploy web apps and serve both static and dynamic content to a global CDN (content delivery network).
Security & Protection While Firebase does have a CDN, it doesn't offer you distributed denial of service attacks (DDoS) prevention, web application firewall (WAF), or rate-limiting. All of these are incredibly important to prevent malicious actors from breaking your system or stealing your data.
Firebase can be a good choice to deploy static websites, and Single Page Apps. I like to use Firebase Hosting mainly because I tested many different providers and Firebase offers an awesome speed across the continents without the need for a separate CDN on top, since the CDN is built-in for free.
Pair Cloud Functions with Firebase Hosting to generate and serve your dynamic content or build REST APIs as microservices. Cloud Functions for Firebase lets you automatically run backend code in response to HTTPS requests. Your code is stored in Google's cloud and runs in a managed environment.
There's new info on this: https://firebase.google.com/docs/hosting/functions (example: https://github.com/firebase/functions-samples/tree/master/authorized-https-endpoint )
You should be able to use a Cloud Function to restrict access to content (which is server-side authenticated and generated).
No. Firebase hosting doesn't implement access control to static resources.
Also see the discussion in the comments of this question: Firebase route security without AngularFire
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