Firebase 托管:防止未经授权访问 URL [英] Firebase Hosting: Preventing unauthorized access to URL

查看:29
本文介绍了Firebase 托管:防止未经授权访问 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图保护 firebase auth 背后的一些页面 - 但是每次我尝试打开它们时 - 我似乎都能浏览到它们.即使我遵循文档.

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?

如果不构建大量自定义代码,它似乎不受直接支持.如果它们可以支持简单的 htaccess 文件或类似文件,那就太好了.- 这是发布功能请求的链接https://firebase.google.com/support/contact/bugs-features/

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/

推荐答案

如果您知道 URL,发布到 Firebase 托管的所有静态内容(HTML、CSS、JS 和其他文件)都可以公开访问.没有您可以轻松配置来更改此行为的身份验证控件.

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.

如果您需要保护内容,您可以通过 Cloud Functions 设置一些代码 检查用户的身份验证并根据其决定提供内容.

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.

这篇关于Firebase 托管:防止未经授权访问 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆