I\'ve got an extension for which some users contribute money or effort. I\'d like to be able to identify those users by their e-mail addresses, so I can display a \"Thank You!\"
Allright, Got her solved. This website basically describes it:
http://smus.com/oauth2-chrome-extensions/
But not all of it is explained there. So:
First of all you need an API Client ID and Client Secret so that you can be authorized by the user to use their details. The following steps will set that up in a fashion that will work with a chrome extension:
Second you'll need the oauth2 javascript library, which is available here: https://github.com/borismus/oauth2-extensions/tree/master/lib
You'll need to put that in a folder called oauth2 in the same directory as your html file.
In you html file add the following stuff:
In your manifest.json you need:
"permissions": ["https://accounts.google.com/o/oauth2/token", "https://www.googleapis.com/oauth2/v1/userinfo"]
Also in the manifest file you will need:
"content_scripts": [ {
"matches": ["http://www.google.com/robots.txt*"],
"js": ["oauth2/oauth2_inject.js"],
"run_at": "document_start" }
That should pretty much take care of it.