【问题标题】:Get google profile image with firebase id获取带有 firebase id 的 google 个人资料图片
【发布时间】:2018-10-24 07:55:36
【问题描述】:

我一直在使用 firebase 进行登录,它返回给我一个 firebase 的 uid,正如我所见,它不可能发出获取 google id 的请求。

我知道 firebase 帐户与 Google 帐户不同,但我的问题是:有一些可能的方法可以让我使用 firebase 帐户 uid 来获取 Google 个人资料图片,而无需更改我的登录方法以使用 Google+ 登录?

获取 Google 头像的网址是:https://developers.google.com/apis-explorer/#search/profile/m/plus/v1/plus.people.get

【问题讨论】:

    标签: firebase google-api firebase-authentication google-authentication


    【解决方案1】:

    您应该能够使用他们的 uid 获取用户个人资料。 你可以使用

    admin.auth().getUser(uid).then(function(profile){...})
    

    拥有帐户后,您应该能够使用 firebase 属性访问他们的个人资料,在您的情况下,请使用 photoURL 属性。 希望这可以帮助 https://firebase.google.com/docs/auth/admin/manage-users

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-15
      • 2018-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-28
      • 1970-01-01
      • 2011-06-23
      相关资源
      最近更新 更多