I am using omniauth-google-oauth2 with branch: 'v0.2.10' for below mentioned scopes in code
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, APP_CONFIG['google_oauth2']['client_id'], APP_CONFIG['google_oauth2']['client_secret'], {
access_type: 'offline',
scope: 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/calendar',
redirect_uri: "#{APP_CONFIG['site_url']}auth/google_oauth2/callback",
skip_jwt: true,
prompt: 'consent',
provider_ignores_state: true
}
end
But when i try to sync calendar, it gives me invalid_credential error as below
auth/failure?message=invalid_credential?...
No more details available in response.
Please suggest me if i am doing anything wrong.
Does the
APP_CONFIG['site_url']
come with slash in the end or not? anyway i thank it most be like that:#{APP_CONFIG['site_url']}/auth/google_oauth2/callback
instead of :#{APP_CONFIG['site_url']}auth/google_oauth2/callback