小编Pra*_*odK的帖子

com.google.android.gms.auth.GoogleAuthException:未知

我正在尝试使用Oauth2来验证我的设备中登录的Google用户.我创建了客户端ID,但我无法获得预期的结果.

代码是:

String mScope="oauth2:server:client_id:NNNNNNNNNNN.apps.googleusercontent.com:api_scope:https://www.googleapis.com/auth/plus.login";

protected Void doInBackground(String... accountName) {

        Log.i("Inside on AsynTask:","I am here");
        String accName=accountName[0]; 

        try {
            token1 = GoogleAuthUtil.getToken(Web_view_demo.this,
                    accName,
                    mScope);
            Log.i("Inside on AsynTask:","I am here");
        } catch (IOException transientEx) {
            // Network or server error, try later
            Log.e("IO", transientEx.toString());
        } catch (UserRecoverableAuthException e) {
            // Recover (with e.getIntent())
            Log.e("UserRecover", e.toString());
            //Intent recover = e.getIntent();
            //startActivityForResult(recover, 1);
        } catch (GoogleAuthException authEx) {
            // The call is not ever expected to succeed
            // assuming you have already verified that …
Run Code Online (Sandbox Code Playgroud)

android oauth google-authentication

10
推荐指数
1
解决办法
8062
查看次数

标签 统计

android ×1

google-authentication ×1

oauth ×1