【发布时间】:2019-12-31 20:58:10
【问题描述】:
参考文档和 SO,但是:
如果我获得了用户的 uid,因为 Firebase 在身份验证后将其交给了我,这还不足以证明该特定用户实际上已在我的网站上进行了身份验证吗?
this.afAuth.auth.onAuthStateChanged((user) => {
if (user) {
// safe to use the user.uid to populate my users collection
} else {
// user.uid is logged out now
}
});
这样我就可以在我的用户表中添加其他信息:
myUsersCollection/[uid]/the_other_things:"这里有些东西"
Why can't we use getUid() to authenticate with your backend server in firebase authentication 的帖子似乎没有为我解决这个问题?
有没有办法可以欺骗 onAuthStateChanged 事件来欺骗我?如果我确实从其他来源获得了 uid,那么我当然不能确定。但只要我正确使用状态更改并信任 Firebase 身份验证,getToken() 如何帮助证明身份验证?
另外,即使 getToken() 仍在docs 中,它是否真的贬值了?
提前感谢您的洞察力!
【问题讨论】:
标签: firebase firebase-authentication angularfire