如何自定义firebase数据库、身份验证和存储的域名?

如何自定义firebase数据库、身份验证和存储的域名?,firebase,firebase-realtime-database,firebase-authentication,firebase-storage,Firebase,Firebase Realtime Database,Firebase Authentication,Firebase Storage,我知道我可以为firebase主机定制域名。 但我如何定制firebase数据库、身份验证和存储域名? 例如 我试图为该域命名(例如,从cname auth.example.com到example.firebaseapp.com) 但这会导致显示证书错误。 我可以解决这个问题吗?您是否也更改了代码中的firebase脚本片段 <script src="https://www.gstatic.com/firebasejs/4.4.0/firebase.js"></script&g

我知道我可以为firebase主机定制域名。 但我如何定制firebase数据库、身份验证和存储域名? 例如

我试图为该域命名(例如,从cname auth.example.com到example.firebaseapp.com) 但这会导致显示证书错误。
我可以解决这个问题吗?

您是否也更改了代码中的firebase脚本片段

<script src="https://www.gstatic.com/firebasejs/4.4.0/firebase.js"></script>
<script>
  // Initialize Firebase
  var config = {
    apiKey: "yourkey",
    authDomain: "auth.example.com",
    databaseURL: "https://db.example.com",
    projectId: "yourid",
    storageBucket: "storage.example.com",
    messagingSenderId: "id"
  };
  firebase.initializeApp(config);
</script>

//初始化Firebase
变量配置={
apiKey:“你的钥匙”,
authDomain:“auth.example.com”,
数据库URL:“https://db.example.com",
投影:“你的ID”,
storageBucket:“storage.example.com”,
messagingSenderId:“id”
};
firebase.initializeApp(配置);

Firebase不提供在您自己的域中为我们的服务添加白标签的功能

您可以选择通过托管+云功能代理所有流量,但这将是大量额外工作


需要在这些服务上提供您自己的自定义域吗?

我正在使用angular,我已将配置更改为该域。问题是,firebase db或其他证书仅在*.firebaseio.com中有效,因此当我访问它时,浏览器将显示证书错误。(https)代码中是否提到旧域名?如果不是,我不确定问题出在哪里..你不能只使用CNAME,因为这会破坏这些名称的SSL主机名验证。无论如何,为什么您需要更改这些?我也在寻找这个选项,在我的例子中,我希望能够创建一个cname,以便缓存特定的.json端点。我无法控制example.firebaseio.com/clients.json的缓存,但我可以通过data.example.com/clients.json控制缓存。是否有其他可能的解决方案?因为firebaseio.com在中国被阻止,所以我们需要使用自定义域。
<script src="https://www.gstatic.com/firebasejs/4.4.0/firebase.js"></script>
<script>
  // Initialize Firebase
  var config = {
    apiKey: "yourkey",
    authDomain: "auth.example.com",
    databaseURL: "https://db.example.com",
    projectId: "yourid",
    storageBucket: "storage.example.com",
    messagingSenderId: "id"
  };
  firebase.initializeApp(config);
</script>