使用自定义域名作为Firebase数据库/身份验证/存储URL

时间:2019-01-05 08:16:53

标签: firebase firebase-realtime-database google-cloud-platform

Firebase将这种模式用于其数据库,身份验证和存储URL

auth: https://[PROJECT_ID]. firebaseapp.com
database: https://[PROJECT_ID].firebaseio.com
storage: https://[PROJECT_ID]. appspot.com

我需要像这样将这些URL映射到我的自定义域

auth: https://fbauth. [MY_CUSTOM_DOMAIN].com
database: https://fbdb.[MY_CUSTOM_DOMAIN].com
storage: https://fbstorage. [MY_CUSTOM_DOMAIN].com

这将有助于改善我的网站SEO,因为所有请求都将从我的域中提供

我在Google上搜索了它,发现了此链接Serving an API from Your Domain Name ,但我正在寻找简单明了的解决方案。

请先让我知道我是否做对了 其次,让我知道我该怎么做

1 个答案:

答案 0 :(得分:1)

如果没有自己的包装器,则无法从您自己的域提供Firebase实时数据库。之前已经尝试过,但是据我所知没有人完成它。另请参见Firebase custom domain name for database

这同样适用于Cloud Storage for Firebase。如果要控制从中提供服务的域,则必须实现代理/包装器。这可能违反了为什么要使用Cloud Storage的目的。

您可以use a custom domain for the email verification flow for Firebase Authentication。但是据我所知,无法为其他身份验证操作设置自定义域。因此,这里的包装/代理也是您唯一的选择。另请参见:Add custom domain to be used with firebase real time database (i.e. verify email links)Custom authDomain in Firebase(其中Michael's answer听起来很有希望)。

相关问题