Firebase Java客户端使用自定义身份验证 [英] Firebase Java client with custom authentication
本文介绍了Firebase 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屋!
查看全文