5

I'm working on a Chrome Extension that interacts with Google Calendar. I've open sourced it, and the code can be found on GitHub: https://github.com/joshholat/Add-to-Calendar-Chrome-Extension

It needs to authorize with Google's oAuth in order to be able to edit the users calendar. Until recently, that was working fine. However, one day it for some reason stopped working. When I do the following code, it opens a new tab from oauth that is supposed to ask for permission however the page never loads but rather freezes on "Redirecting...". Therefore, there's no way for me to authorize and test my code.

Ideas?

var oauth = ChromeExOAuth.initBackgroundPage({
 'request_url': 'https://www.google.com/accounts/OAuthGetRequestToken',
 'authorize_url': 'https://www.google.com/accounts/OAuthAuthorizeToken',
 'access_url': 'https://www.google.com/accounts/OAuthGetAccessToken',
 'consumer_key': 'anonymous',
 'consumer_secret': 'anonymous',
 'scope': 'http://www.google.com/calendar/feeds/',
 'app_name': 'Add Events to Google Calendar'

});

oauth.authorize(function() { alert("auth"); });

Josh Holat
  • 51
  • 1
  • 3

2 Answers2

3

I got it working after adding the following permissions to manifest.json

"permissions": [
  "tabs",
  "https://www.google.com/"
],
Marek Grzenkowicz
  • 17,024
  • 9
  • 81
  • 111
cyberixae
  • 843
  • 5
  • 15
1

Make sure you are using the latest version of the Chrome OAuth sample code. I know at some point here was an update to how Chrome handled tabs and the OAuth sample got patched to work again.

abraham
  • 46,583
  • 10
  • 100
  • 152