使用自定义域名作为Firebase数据库/身份验证/存储URL [英] Use custom domain name as firebase database/auth/storage URL

查看:45
本文介绍了使用自定义域名作为Firebase数据库/身份验证/存储URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Firebase use this pattern for its database and auth and storage URL

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

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

I need to map these URLs to my custom domain like this

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

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

It will help to improve my website SEO because all request will be served from my domain

我搜索了它,并找到了此链接从您的域名,但我正在寻找简单明了的解决方案.

I googled it and found this link Serving an API from Your Domain Name but I'm looking for a straight-forward solution.

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

Could you please first let me know if I'm doing the right thing And second, let me know how I should do this

推荐答案

如果不编写自己的包装,则无法从您自己的域提供Firebase实时数据库.之前已经尝试过,但是据我所知没有人完成它.另请参见数据库的Firebase自定义域名

There is no way to serve the Firebase Realtime Database from your own domain, without writing your own wrapper around it. It has been tried before, but to my knowledge nobody ever finished it. Also see Firebase custom domain name for database

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

The same applies to Cloud Storage for Firebase. If you want to control the domain it is served from, you'll have to implement a proxy/wrapper. That probably defeats the purpose of why you use Cloud Storage to begin with.

您可以将自定义域用于Firebase身份验证的电子邮件验证流程.但是据我所知,无法为其他身份验证操作设置您的自定义域.所以在这里,包装/代理将是您唯一的选择.另请参阅:添加用于Firebase实时数据库(即验证电子邮件链接)的自定义域自定义authDomain在Firebase中(其中迈克尔的答案听起来很有希望).

You can use a custom domain for the email verification flow for Firebase Authentication. But as far as I know there is no way to set up your custom domain for other authentication operations. So here too, a wrapper/proxy would be your only option. Also see: Add custom domain to be used with firebase real time database (i.e. verify email links), and Custom authDomain in Firebase (where Michael's answer sounds promising).

这篇关于使用自定义域名作为Firebase数据库/身份验证/存储URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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