是否可以将 Firebase Auth 与外部 SQL 数据库集成?
Is it possible to integrate Firebase Auth with an external SQL database?
我想使用 Firebase Auth 对移动 phone 客户端进行身份验证,但我有一个现有的 PostgreSQL 数据库,其中包含许多我不想转换为 NoSQL 的函数和触发器。是否可以使用 Firebase 对用户进行身份验证,然后允许他们安全地读取和写入 PostgreSQL 数据库中的数据?这样做的正确方法是什么?我来自网络开发背景,所以我习惯于基于会话的身份验证而不是基于令牌的身份验证。试图绕过它。
如果您已经有一个与您的 PostgreSQL 数据库通信的后端,您可以使用 user.getToken()
(https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser#public-constructor-summary) and then verify the token on your backend (https://firebase.google.com/docs/auth/server#verify_id_tokens) 获得一个令牌。然后,使用令牌中的 uid
作为用户 ID。
我想使用 Firebase Auth 对移动 phone 客户端进行身份验证,但我有一个现有的 PostgreSQL 数据库,其中包含许多我不想转换为 NoSQL 的函数和触发器。是否可以使用 Firebase 对用户进行身份验证,然后允许他们安全地读取和写入 PostgreSQL 数据库中的数据?这样做的正确方法是什么?我来自网络开发背景,所以我习惯于基于会话的身份验证而不是基于令牌的身份验证。试图绕过它。
如果您已经有一个与您的 PostgreSQL 数据库通信的后端,您可以使用 user.getToken()
(https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser#public-constructor-summary) and then verify the token on your backend (https://firebase.google.com/docs/auth/server#verify_id_tokens) 获得一个令牌。然后,使用令牌中的 uid
作为用户 ID。