node.js - Google oAuth2 - consent screen and redundant popup
问题描述
I'm working on a google calendar integration and everything is working as expected except of one thing: for some reason when user is redirected to the consent screen google first shows the popup asking to allow the required permissions:
And once user picks "deny" or "allow" the user is presented with the final consent screen where they must click "allow" or "cancel" again:
The question is: how do I get rid of that popup and make sure the user has to click the "allow" button only once just like in the last referencing screenshot below?
After more research I've found that there are web apps that require the same calendar integration but there is no that popup and the users are redirected straight to the final consent screen.
One more thing I've noticed is that while in my case consent screen shows checkbox while in the referenced web app there is no checkbox and user must click allow or cancel once (and in general the screen looks a bit differently):
Here is my code of generating the authUrl:
//"googleapis": "^39.2.0",
const {google} = require('googleapis/build/src/index');
let oauth2ClientGlobal = new google.auth.OAuth2(
"{{clientId}}",
"{{clientSecret}}",
"https://example.com/calendarCallback"
)
let authUrl = oauth2ClientGlobal.generateAuthUrl({
access_type: 'offline',
scope: ['https://www.googleapis.com/auth/calendar.events'],
});
解决方案
The new screens are intended behavior. Google announced that they will rollout granular permission control in 2018. See https://www.blog.google/technology/safety-security/project-strobe/ and https://developers.googleblog.com/2018/10/more-granular-google-account.html.
推荐阅读
- javascript - Non-greedy capturing parenthesis
- python-3.x - 如何为 CIFAR 10 pytorch 教程添加 GPU 计算?
- amazon-web-services - 如何通过节点红色 MQTT 设置 AWS SNS 电子邮件的电子邮件主题?
- swift - “找不到适用于应用程序的 WatchKit 1.0 应用程序包”Xcode 10.1 Swift 4.2
- excel - 如何使用 JCL 将 SQL 结果处理成 CSV/Excel 附件?
- javascript - 如何在图表中使用 CSV 中的值?
- python - 使用 SciLearn Kit 读取 Pandas 数据帧时遇到问题
- r - 按组有条件地过滤来自时间序列的观察
- android - 如何在大马家滑块中显示下一张图片的一部分?
- c++ - 成员未在基类模板中声明