Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Firebase hosting restrict access to resources?

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?

like image 819
markovuksanovic Avatar asked Nov 30 '14 09:11

markovuksanovic


People also ask

What does firebase hosting do?

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).

Does firebase hosting have DDoS protection?

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.

Should I use firebase hosting?

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.

Is firebase hosting dynamic?

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.


2 Answers

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).

like image 62
WraithKenny Avatar answered Oct 20 '22 10:10

WraithKenny


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

like image 32
Frank van Puffelen Avatar answered Oct 20 '22 10:10

Frank van Puffelen