首页 > 解决方案 > 是否能够将 Firebase 用户存储到我们自己的数据库中?

问题描述

如果我使用用户注册并通过firebase身份验证登录,则用户信息存储在firebase数据库端。如何获取用户信息(如 FirstName、LastName、Gender 等)并存储在自己的数据库中?是否使用访问令牌调用我的 API 来检查用户身份?

标签: firebasefirebase-authenticationasp.net-core-2.0

解决方案


我建议在创建用户时使用云功能来触发。

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.
});

参考:https ://firebase.google.com/docs/functions/auth-events


推荐阅读