一旦用户在我的android应用中执行google sigin,我就会使用Fire base google sigin,我将使用android代码获取帐户
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestServerAuthCode(getString(R.string.default_web_client_id), false)
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
GoogleSignInAccount account = result.getSignInAccount();
account .getServerAuthCode();
} else {
LogUtil.d(TAG, "result is fail = "+result);
}
`
请检查下面的邮递员照片以发送投递请求以获取访问令牌 postman tried image
我注意到default_web_client_id
(由Google在应用中生成)是
<string name="default_web_client_id" translatable="false">457480315155-7f78c0vsh3gr0jt0ooon....</string>
和我创建的client_id
和client_secret
都不同,应该相同?