【发布时间】:2015-05-28 00:00:58
【问题描述】:
我从发送到服务器的 Android SDK 获取访问令牌。在服务器端,我正在调用以下 API 来验证我的令牌:
https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=<token here>
来自 Google,我收到以下回复(添加了部分回复):
{\"statusCode\":200,\"body\":\"{n \"issued_to\":
\"407408718192.apps.googleusercontent.com\",n \"audience\":
\"407408718192.apps.googleusercontent.com\",n \"user_id\":
\"110586055381870434283\",n \"scope\":
\"https://www.googleapis.com/auth/plus.login
https://www.googleapis.com/auth/plus.me"}
不幸的是,这个 JSON 不可解析,因为有反斜杠,我无法验证令牌身份。
这是 Google API 的问题还是我需要应用任何正则表达式?
【问题讨论】:
-
您能找到解决方案吗?我有同样的问题。
标签: json node.js oauth google-oauth