在我的应用程序中,我创建了一个市场应用程序,它使用
' https://www.googleapis.com/auth/userinfo.email '
' https://www.googleapis.com/auth/userinfo.profile '
现在根据谷歌将关闭userinfo
端点。我正在尝试将两个范围都更改为等效范围“电子邮件”和“个人资料”。现在,当我尝试使用新范围刷新用户令牌时。我得到以下错误
{
"error" : "access_denied",
"error_description" : "请求的客户端未授权。"
}
我正在使用下面的代码来刷新用户的令牌
new Builder().setTransport(NET_HTTP_TRANSPORT)
.setJsonFactory(JACKSON_FACTORY)
.setServiceAccountId(googleOAuthService.getServiceClientEmail())
.setServiceAccountScopes(googleOAuthService.getScopes())
.setServiceAccountUser(email)
.setServiceAccountPrivateKeyFromP12File(keyFile);
我无法将范围更改为https://www.googleapis.com/auth/plus.me
,因为它将再次显示同意屏幕。
我想我需要在谷歌项目市场 sdk 配置中添加“电子邮件”和“个人资料”范围,但它给了我错误,即给定范围无效。
任何人都请帮助我如何解决它。提前致谢