addon-google-oauth2
Authenticate with Google OAuth2 from Addon SDK. It's useful for developing Firefox addons with jpm and Google services.
Tutorial
Sample code:
var oauth=; var oauth2_options= client_id: "CLIENT_ID" client_secret: "CLIENT_SECRET" scopes: "https://www.googleapis.com/auth/adsense.readonly" // For example, AdSense Management API in read only mode; { //USE THE token TO CALL Google APIs} { oauth;}
It will use the refresh token if available or do a manual login.
If you are sure that the token hasn't exired yet you can call the function oauth.getToken();
which only returns the last valid token (if any).
In your data/ folder you must put two files for the Google OAuth2 code verification. These files work
login.html
Google AdSense Earnings Login Code from Google: Login
login.js
var button=document;button;