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'],
});
Answer
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.
Related Questions
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error