最佳实践从Firebase用户UID获取用户信息 [英] Best practice Fetch user's information from the Firebase User UID

查看:297
本文介绍了最佳实践从Firebase用户UID获取用户信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Firebase的Facebook和Email Login集成到我的iOS应用程序中.

I have integrated Firebase's Facebook and Email Login into my iOS application.

尽管如此,我只想将Firebase用户ID存储在我的API数据库中.

Although, I would like to only store the Firebase User ID in my API database.

因此,从我的后端服务器(例如Ruby)中,考虑到我具有Firebase用户UID,如何查询firebase以说出用户名和用户的电子邮件地址.

Therefore from my backend server (say Ruby) how can I query firebase to get say the user's name and user's email address given that I have their Firebase User UID.

谢谢

推荐答案

要直接为应用的任意用户读取用户数据,请使用Firebase Admin SDK: https://firebase. google.com/docs/auth/admin/manage-users#retrieve_user_data

To directly read user data for arbitrary users of your app, you'd use the Firebase Admin SDK: https://firebase.google.com/docs/admin/setup. This specific page shows how to read user data: https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data

通过Admin SDK读取用户数据目前仅适用于Node.js和Java.由于Ruby不在此列表中,因此您需要将用户信息保留在其他位置. Firebase数据库是存储此类数据的常用场所,因此任何平台都可以通过其REST API对其进行访问.

Reading user data through the Admin SDK is currently only available for Node.js and Java. Since Ruby isn't on this list, you'll need to keep the user information elsewhere. The Firebase Database is a common place to store such data, so that any platform can access it through its REST API.

这篇关于最佳实践从Firebase用户UID获取用户信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆