简体   繁体   中英

Securely use files stored in Firebase storage, in a browser

I have some PDF files stored in Firebase storage. I would like to a) display the files on a website and b) make it as hard as possible(*) for someone to download the files. Does anyone have any recommendations for how to achieve this?

  • I realise that a smart hacker can probably bypass any protections put in place. My 'bar' is that the files are safe from the average internet user.

I also realise that this might be effectively impossible and I may need to consider alternative set-ups.

Item B is hard to achieve, as normally you would use the file download url in the HTML, like <a href="https://your_now_exposed_pdf_url" /> and anyone with this link could obtain the file.

What you could do is to use a proxy server in the middle to fetch files from firebase and serve them to your frontend, this way at least the real file download URLs are not exposed and you can implement something on the server side to serve those files only to authorized users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM