Set up an OAuth service » History » Version 1
Tom Clegg, 09/23/2013 02:40 PM
1 | 1 | Tom Clegg | h1. Set up an OAuth service |
---|---|---|---|
2 | |||
3 | Tapestry uses OAuth to retrieve survey responses from Google Docs/Drive spreadsheets. |
||
4 | |||
5 | h2. Generate a private key and certificate |
||
6 | |||
7 | Example: |
||
8 | |||
9 | <pre> |
||
10 | openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -sha1 \ |
||
11 | -subj '/C=CA/ST=BC/L=Spillimacheen/CN=YOUR.TAPESTRY.HOSTNAME' \ |
||
12 | -keyout oauth_rsa_key.pem -out oauth_rsa_cert.pem |
||
13 | </pre> |
||
14 | |||
15 | * See https://developers.google.com/gdata/docs/auth/authsub?csw=1#Registered |
||
16 | |||
17 | h2. Register and configure your domain |
||
18 | |||
19 | Assure Google that you control the domain name where your Tapestry installation lives. |
||
20 | |||
21 | https://accounts.google.com/ManageDomain |
||
22 | |||
23 | Set target URL path prefix to: @https://YOUR.TAPESTRY.HOSTNAME/oauth/update@ |
||
24 | |||
25 | Your "manage domain" page should show an OAuth Consumer Key (your domain name) and an OAuth Consumer Secret (an indecipherable alphanumeric string). |
||
26 | |||
27 | Click save. |
||
28 | |||
29 | h2. Set up a new OAuth service |
||
30 | |||
31 | https://YOUR.TAPESTRY.HOSTNAME/admin/oauth_services/new (Admin→OAuth Services→New) |
||
32 | |||
33 | Enter the *name*: @Google Docs@ |
||
34 | |||
35 | Enter the *scope*: |
||
36 | |||
37 | <pre> |
||
38 | https://docs.google.com/feeds/ https://spreadsheets.google.com/feeds/ https://docs.googleusercontent.com/ |
||
39 | </pre> |
||
40 | |||
41 | Copy the *consumer key* from Google |
||
42 | |||
43 | Copy the *private key* from the @oauth_rsa_key.pem@ file you created above. |
||
44 | |||
45 | h2. Test authorization |
||
46 | |||
47 | https://YOUR.TAPESTRY.HOSTNAME/oauth_tokens (Researcher→OAuth Tokens) |
||
48 | |||
49 | Click the Authorize button for Google Docs. |