Set up an OAuth service for Reading the Results of Google Surveys¶
Tapestry uses Google's OAuth2 to retrieve survey responses from Google Sheets/Drive spreadsheets.
Set up a Google Account for Interfacing via Oauth¶
- Create a Google "Project" within your account here: https://console.developers.google.com/project - name the project whatever you like.
- Using the navigator on the left, go to the "APIs" page for your new project.
- In the "Browse APIs" secion, find the one labelled "Drive API" and enable it.
Obtain Client Credentials for your Tapestry Domain¶
- Again using the navigator on the left, go to the "Credentials" page for your porject.
- Click on the "Create new Client ID" button.
- You will need the "Client ID" and the "Client Secret" that results from this, and you should also note the exact full "Redirect URI" (a.k.a. "Callback URI").
Create the Google OAuth Service in Tapestry¶
- As an administrator user, go to the "OAuth Services" page using the "Admin" menu
- If there is an existing Google OAuth service, you should remove or modify it to use your new credentials. (Note: a service can only be removed if no tokens exist for it.)
- Create a name for the service, e.g. "Google Spreadsheets"
- Select "Google" as the service type
- Enter "https://accounts.google.com" for the "Endpoint URL"
- Enter the Redirect URI from above as the "Callback URL" - remember that it must be of the form "https://your.tapestry.hostname/oauth2callback" to function
- Enter the "Client ID" and "Client Secret" Google gave you, as the "Key" and "Secret" respectively.
- Click on "Create OAuth Service".
Authorize Tapestry to access to your spreadsheets¶
- Go to the "OAuth Tokens" page from the "Researcher" menu.
- Click on the "Authorize" button, using Google to authenticate.