身份验证代码中的android未经授权的客户端错误,以获取访问令牌?

时间:2019-04-23 04:15:52

标签: android google-signin google-authentication

一旦用户在我的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_idclient_secret都不同,应该相同

0 个答案:

没有答案