See oauth-2legged-test.js
for how to make a 2-legged OAuth request to a Google Data API.
See oauth-signed-fetch-test.js
for how to verify a signed fetch from Google. See oauth-signed-fetch-test-gadget.xml
for a test gadget you can add to a Google Sites page (see below for how to do that).
- On a Google Sites page for your domain, add the gadget http://google-feedserver.googlecode.com/svn/trunk/resources/gadgets/private-gadget-editor/spec.xml by URL.
- In the Private Gadget Editor, press
New
to create a gadget private to your domain - Copy the content of http://github.com/jyang/google-oauth/raw/master/oauth-signed-fetch-test-gadget.xml to the editor to overwrite its content
- Press
Save
and enter gadget namesigned-fetch-text.xml
to save it - On another Google Sites page for the same domain, add gadget
http://feedserver-enterprise.googleusercontent.com/a/<mydomain>/g/PrivateGadgetSpec/signed-fetch-test.xml
by URL - In the test gadget, enter public URL to the server that runs oauth-signed-fetch-test.js and press
Send a Signed Fetch
to send a signed fetch from Google Sites to the test server, which will echo back the email address of the user