Google 加号登录不会返回id_token
Google plus signin does not return id_token
var login = function () {
var deferred = $q.defer();
gapi.auth.authorize({
client_id: $googleplus.config('clientId'),
scope: $googleplus.config('scopes'),
immediate: false
},function(response){
console.log(response.id_token)/*Not defined */
deferred.resolve(response);
});
return deferred.promise;
}
我使用上面的代码对我的用户进行身份验证,但由于某些原因,我没有从请求中获得id_token。我需要此令牌才能与亚马逊认知集成这是我正在使用的范围范围:"OpenID 电子邮件配置文件 https://www.googleapis.com/auth/plus.login">
通过包含此参数找到了我问题的答案。response_type:"令牌id_token">
var login = function () {
var deferred = $q.defer();
gapi.auth.authorize({client_id: $googleplus.config('clientId'),
scope: $googleplus.config('scopes'),
response_type: 'token id_token',
immediate: false
},function(response){
deferred.resolve(response);
});
return deferred.promise;
}
相关文章:
- PHP会话ID变量与AJAX一起返回
- 包含插入的Meteor方法没有返回记录ID作为结果
- AngularJS-工厂中promise ID字段的返回值
- 将外部函数返回的id传递给内部函数
- 使用this和onclick()时不能返回id值
- 为什么数据列表选项的id返回空值
- Javascript setInterval未及时返回ID
- 代码点火器动态表单下拉列表,不返回值,而是返回 ID
- 猫鼬对 id 字段的请求返回 id 和_id
- 自动增量不会在猫鼬中返回 ID
- 从Ajax生成的DOM元素返回id
- .post()返回ID不受页面Jquery的影响
- cssRule对象在样式表中没有返回id选择器样式
- 将onclick事件附加到返回id的锚定元素
- 如何获得ajax返回id隐藏变量..在请求页面
- Angular:从父函数$http中返回id
- 从新插入的文档返回id - mongoDB
- 选择查询结果并返回ID值
- 希望在下划线筛选器后返回ID列表
- 如何在帆中保存记录时返回 id 数组.js