firebase - Ionic App:Firebase Authenticate with using OAuth Provider 显示 AUTH_DOMAIN 而不是自定义域
问题描述
我按照 Firebase Authentication docs ( Authenticate Using OAuth Providers with Cordova ) Link实现了使用 Google API 登录。但是,它显示项目默认 AUTH_DOMAIN。如何更改它以显示自定义 URL?
<universal-links>
<host name="example.page.link" scheme="https" />
<host name="example-app.firebaseapp.com" scheme="https">
<path url="/__/auth/callback"/>
</host>
</universal-links>
解决方案
您在将 Firebase 添加到您的应用时是否设置了您的域?
<script src="https://www.gstatic.com/firebasejs/5.8.2/firebase.js"></script>
<script>
// Initialize Firebase
// TODO: Replace with your project's customized code snippet
var config = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
projectId: "<PROJECT_ID>",
storageBucket: "<BUCKET>.appspot.com",
messagingSenderId: "<SENDER_ID>",
};
firebase.initializeApp(config);
</script>
此外,使用您自己的域并不像听起来那么容易。查看这篇文章了解更多信息。
推荐阅读
- python - 使用 xlsxwriter 将一维 numpy 数组写入 excel
- java - 线程“主”org.apache.spark.sql.catalyst.parser.ParseException 中的异常
- javascript - 当用户 (A) 使用 Firebase 云功能和 Flutter 关注用户 (B) 时如何接收通知
- r - 使用 R DBI 包插入到
- ios - 在 swift 中使用 fscalendar 从 API 响应中获取事件的值
- spring-cloud-stream - 是否实现基于任务或流的方法
- r - 当表可以有不同数量的列时,如何设置 DT::datatable 中的所有列宽?
- haskell - 如何将值打印/编码到 Dhall 中?
- javascript - 在 find() jQuery 之后调用 filter()
- ios - 如何使用swift最新版本计算ios中APP的cpu使用率?我现在在 xCode 11 上