将Firebase Auth从Android SDK切换到Firebase Admin SDK [英] Switching Firebase Auth from Android SDK to Firebase Admin SDK

查看:55
本文介绍了将Firebase Auth从Android SDK切换到Firebase Admin SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我有一个使用Firebase Auth进行用户身份验证的android应用.我想将身份验证部分移至Admin Sdk服务器,以便android应用向服务器发出http请求,然后服务器执行身份验证.不幸的是,用于Java的Admin SDK没有signInWithEmailAndPassword方法.有没有办法解决这个问题,或者我还必须在服务器上包含android sdk吗?

Currently I have an android app that uses the Firebase Auth for user Authentication. I would like to move the authentication part to the Admin Sdk server, such that The android app makes an http request to the server and the server does the authentication. Unfortunately the the Admin SDK for Java does not have the signInWithEmailAndPassword method. Is there a way to go about this or do I have to include the android sdk on the server also?

推荐答案

Firebase身份验证不支持这种情况.客户端应用必须使用客户端SDK进行身份验证,以便可以管理ID令牌,该ID令牌使其他SDK可以针对为这些产品(实时数据库,Firestore,存储)定义的安全规则工作.

That's not a supported situation with Firebase Authentication. The client app must authenticate itself using the client SDK so that it can manage the ID token that lets the other SDKs work with respect to the security rules defined for those products (Realtime Database, Firestore, Storage).

您可以直接从客户端调用身份验证API ,但这是最好让客户端SDK为您完成所有工作.

You could call the Authentication APIs directly from the client, but it's far better to just let the client SDK do all that work for you.

这篇关于将Firebase Auth从Android SDK切换到Firebase Admin SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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