I have a rails app with google-api-client and omniauth-google-oauth2 gems. I would like to integrate google calendar. I tried to do the authentication with the code below, but it failed.
The problem is when I change the scope let's say to: scope: ['email'] or even to scope: ['hahahaha'] I get the same response from google which is shown below the code. After playing with it for a while I gave up and waited some time then tried again and I got a new error response. I tried to change the code but I got stuck again this time with another error. Is there a time limit or why the response doesn't het updated right after changing the code?
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, ENV['GOOGLE_API_KEY'], ENV['GOOGLE_API_SECRET'], {
scope: ['email, profile, calendar'],
access_type: 'offline'
}
end
error message from google:
Error: invalid_scope
Some requested scopes were invalid. {valid=https://www.googleapis.com/auth/calendar, [invalid= profile, https://www.googleapis.com/auth/email,]}