构建GoogleSignInOptions时,firebase serverClientId [英] firebase serverClientId when building GoogleSignInOptions

查看:168
本文介绍了构建GoogleSignInOptions时,firebase serverClientId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google登录工作流程来获取GoogleSignInAccount对象.我想通过我的Firebase应用对Google用户进行身份验证,该应用需要一个令牌,可以使用

I'm using the google sign-in workflow to get a GoogleSignInAccount object. I want to authenticate google users to my firebase app, which requires a token which can be requested using requestIdToken(String serverClientId) when building my google client api. I'm not sure what to put as my serverClientId?

推荐答案

这是 googleClientId是客户端ID,如 Firebase文档中所述用于Google身份验证.需要注意的最重要的事情是,尽管您正在构建一个Android应用程序,但是您仍然需要创建一个 Web应用程序.

Where googleClientId is the client ID as described in the Firebase documentation for Google authentication. The most important thing to note there is that you need to create a web application, despite the fact that you're building an Android app.

但是:这些天您不再需要指定ID令牌了.在FirebaseUI 0.3.1中,我们将切换到

But: you don't need to specify an id token anymore these days. In FirebaseUI 0.3.1, we'll be switching to this for building the sign-in options:

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    .requestEmail()
    .build();

少一个值得担心的配置值. :-)

One less configuration value to worry about. :-)

这篇关于构建GoogleSignInOptions时,firebase serverClientId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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