Firebase Java客户端使用自定义身份验证 [英] Firebase Java client with custom authentication

查看:233
本文介绍了Firebase Java客户端使用自定义身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个允许自定义身份验证的Firebase Java客户端。因此,我阅读文档并查看了这个answer ,但我还没有确定是否有一个用于Firebase 3的纯java客户端,允许使用令牌进行自定义身份验证。



据我所知:


  • Java库应该是firebase-server-sdk,它没有FirebaseAuth中的任何方法,它们在Android SDK中就像signInWithCustomToken一样。

  • Android SDK仅适用于Android,甚至不在maven central上,似乎对Google Play服务有依赖性。 这里我认为可以设置一个uuid Java SDK客户端,但我会的仍然需要服务帐户的凭据,这只是一个令牌不起作用。所以如果我有一个普通的Java应用程序,它应该是一个基于Firebase客户端的简单自定义身份验证令牌,那么我就没有这个库了。 那么你应该使用java的firebase-server-sdk来为你的服务器上的自定义标记添加自定义标记。然后,将该令牌传递给客户端,并调用signInWithCustomToken(mintedToken)。这将会登录用户并生成一个Firebase Id令牌。


    I'm looking for a Firebase Java client that allows custom auth.

    So I read the documentation and had a look at this answer but I'm still not sure if there is a plain java client for Firebase 3 that allows custom auth with a token.

    As I understand it:

    • The Java library is supposed to be firebase-server-sdk, which does not have any of the methods in FirebaseAuth that are in the Android SDK like signInWithCustomToken.
    • The Android SDK is Android only and not even on maven central and appears to have dependencies on Google's Play Services.
    • From here I took that it is possible to set an uuid for the Java SDK client, but I would still need the service account credentials, this does not work with just a token.

    So if I have a plain Java Application that is supposed to be a simple custom auth token based Firebase client I have no library at the moment?

    解决方案

    you are supposed to mint the custom token on your server using the firebase-server-sdk for java. You then pass that token to the client and call signInWithCustomToken(mintedToken). This will then sign in the user and generate a Firebase Id token.

    这篇关于Firebase Java客户端使用自定义身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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