【问题标题】:What data can i collect from firebase with the different auth providers?我可以使用不同的身份验证提供商从 firebase 收集哪些数据?
【发布时间】:2019-12-03 11:44:18
【问题描述】:

我想使用 firebase Auth Providers 来登录用户,我的问题是我不知道从 auth 提供者发回的关于用户的数据。

我希望收集姓名、电子邮件地址、性别、国家/地区等数据...但我不确定返回的有关用户的信息。

【问题讨论】:

    标签: firebase firebase-authentication


    【解决方案1】:

    Firebase 身份验证将在登录后返回额外的 IdP 用户信息。这是一个网络示例(这也适用于 Android 和 iOS):

    firebase.auth().signInWithPopup(new firebase.auth.FacebookAuthProvider())
      .then((userCredential) => {
        // Additional user info from IdP.
        // This object includes email, first_name, granted_scopes, id, last_name, picture, etc.
        console.log(userCredential.additionalUserInfo.profile);
      })
      .catch((error) => {
        console.log(error);
      });
    

    【讨论】:

      猜你喜欢
      • 2016-08-13
      • 2017-01-10
      • 2020-09-17
      • 2020-09-10
      • 2011-02-03
      • 1970-01-01
      • 1970-01-01
      • 2020-08-28
      • 1970-01-01
      相关资源
      最近更新 更多