Zhe*_*Tan 2 firebase firebase-authentication asp.net-core-2.0
如果我使用通过firebase身份验证进行用户注册和登录,则用户信息存储在firebase数据库端。如何获取用户信息(例如名字、姓氏、性别等)并存储在我自己的数据库中?是否使用访问令牌调用我的 API 来检查用户身份?
我建议在创建用户时使用云函数来触发。
exports.userCreate = functions.auth.user().onCreate((user) => {
const email = user.email; // The email of the user.
const displayName = user.displayName; // The display name of the user.
// Write insert email, displayName, ... to your own database.
});
Run Code Online (Sandbox Code Playgroud)
参考: https: //firebase.google.com/docs/functions/auth-events
| 归档时间: |
|
| 查看次数: |
1734 次 |
| 最近记录: |