firebase - 获取带有 firebase id 的 google 个人资料图片
问题描述
我一直在使用 firebase 进行登录,它返回给我一个 firebase 的 uid,正如我所见,它不可能发出获取 google id 的请求。
我知道 firebase 帐户与 Google 的帐户不同,但我的问题是:有一些可能的方法可以使用 firebase 帐户 uid 来获取 Google 个人资料图片,而无需更改我的登录方法以使用 Google+ 登录?
这是获取 Google 个人资料照片的 URL:https ://developers.google.com/apis-explorer/#search/profile/m/plus/v1/plus.people.get
解决方案
您应该能够使用他们的 uid 获取用户个人资料。您可以使用
admin.auth().getUser(uid).then(function(profile){...})
拥有帐户后,您应该能够使用 firebase 属性访问他们的个人资料,在您的情况下使用 photoURL 属性。希望这有助于 https://firebase.google.com/docs/auth/admin/manage-users
推荐阅读
- opencv - AttributeError:模块'cv2.cv2'没有属性'face'
- c# - 如何解决 Prism + DryIoC 中的依赖关系
- reactjs - 在 ReactJS 中将新文件上传到谷歌驱动器
- javascript - 在反应中动态更改引导进度条值
- android - 嵌套滚动视图中的recyclerview加载缓慢
- php - 无法将输入时间格式转换为 mysql 识别的格式
- python - CSV 到 JSON,带有 Python 的子列表数组
- postgresql - 在 Debian 8.6 Jessie 上启动 PostgreSQL 11 的 Docker 构建权限问题
- c# - 如何创建一组唯一的随机数?
- linux - 在linux perl中从任何编码到utf-8的文件编码