尝试获取范围com.google.api.server.spi.config.scope.SingleAuthScope
Tried and failed to get client id for scope com.google.api.server.spi.config.scope.SingleAuthScopeExpression
在Google Cloud endpoint迁移时间表中,描述了从其他身份验证服务迁移的步骤,其中写道https://www.googleapis.com/auth/userinfo.email作用域已被弃用,并且应该考虑迁移到email作用域(类似于userinfo)。 profile scope)。
在Java类Constants中,其中定义了像Client ID这样的常量,用于我的@Api服务类,我更改了
public static final String EMAIL_SCOPE = "https://www.googleapis.com/auth/userinfo.email";
public static final String EMAIL_SCOPE = "email";
同样在客户端JavaScript的例子形式谷歌,我改变范围变量为
var scopes = 'email';
和在谷歌开发者控制台日志我得到以下例外:
com.google.api.server.spi.auth.AppEngineAuthUtils getCurrentUser:
getCurrentUser: AccessToken; Tried and failed to get client id for scope 'com.google.api.server.spi.config.scope.SingleAuthScopeExpression@ed8e89a9'
com.google.appengine.api.oauth.InvalidOAuthParametersException:
at com.google.appengine.api.oauth.OAuthServiceImpl.makeSyncCall(OAuthServiceImpl.java:139)
在端点方法
中@ApiMethod(name = "authorize", httpMethod="get")
public AppUser authorize(User user) throws NonAuthorizedException {
...
}
User User 参数中的a null是由引擎插入的(当然我是被授权的)。
即使我将作用域更改为profile,这也不起作用。它只适用于localhost,但我认为,这不是问题。
有人可能会问,为什么你可以让它作为userinfo.email呢?我正在寻找一些其他的范围,因为偶尔一些特定的谷歌用户(我不知道什么是具体的关于他们),userinfo。email也不工作。有人能帮帮我吗?谢谢。您不需要更新作用域。
相关文章:
- 如何使用angular js从2个表(在sql server中)中提取数据
- 如何在cloud9中向server.js发送post请求
- 使用谷歌地图、C#、ASP.net、SQL Server显示带有标记的地图.地图未显示
- 使用Javascript或SQL Server将Outlook电子邮件发送到SQL表
- 在 api 文档中 socket.io“Server(srv:http#Server, opts:Object)”是什么
- 在引导程序中从 HTML 表单执行 Python (CGI) 文件.带有Apache Server的JS
- ExpressJS Server - 如何处理多个域
- 当我关联runat=“server”属性时,JQuery UI 按钮集在单选按钮上不起作用
- 节点.js集群模块不会在 http 上释放套接字/端口.Server.close().
- 如何使用 ajax 从 sql Server 获取单选按钮的值,并表示列表单选按钮
- jQuery: setInterval effects on the server?
- 如何在不刷新页面的情况下从 PHP 中的 SQL Server 数据库获取数据
- JavaScript Stack - Web Server 和 API Server:一起或分开
- Google AppRTC Web Server
- webpack-dev-server 不会监视创建的新文件
- 使用php中的单选按钮从MS SQL SERVER中删除行
- 将数据从本地SQL Server同步到Internet上的MySQL Server(实时服务器)
- 如何修复MS SQL Server 2008R2/2012和Javascript之间的日期差异
- 未定义节点不是server.js文件中的函数
- 尝试获取范围com.google.api.server.spi.config.scope.SingleAuthScope