| Index: third_party/gsutil/cloudauth/README.google
|
| diff --git a/third_party/gsutil/cloudauth/README.google b/third_party/gsutil/cloudauth/README.google
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..723dc3f8ce82232cfce4323ceb38e899481e1b76
|
| --- /dev/null
|
| +++ b/third_party/gsutil/cloudauth/README.google
|
| @@ -0,0 +1,51 @@
|
| +This directory contains an example app ("cloudauth") that demonstrates
|
| +how to use an OAUTH2 flow within a web app to authorize App Engine access
|
| +to Google Storage.
|
| +
|
| +To install and try the app, take the following steps:
|
| +
|
| +1. The current code assumes you are already familiar with Google
|
| +App Engine, and and have the App Engine SDK installed. If that's not
|
| +true, start at http://code.google.com/appengine/
|
| +
|
| +In the remainder of these instructions, we assume
|
| +you have gsutil unpacked in /usr/local/gsutil, Google
|
| +App Engine installed at /usr/local/google_appengine, and
|
| +http://pypi.python.org/pypi/google-api-python-client/1.0beta1 installed
|
| +at /usr/local/google-api-python-client
|
| +
|
| +2. Copy the boto, cloudauth, and needed parts of the
|
| + google-api-python-client code into the google_appengine directory:
|
| + % cp -pr /usr/local/gsutil/cloudauth /usr/local/google_appengine
|
| + % cp -pr /usr/local/gsutil/boto/boto /usr/local/google_appengine/cloudauth
|
| + % cp -pr /usr/local/google-api-python-client-1.0beta1/{apiclient,httplib2,oauth2client,gflags*.py} \
|
| + /usr/local/google_appengine/cloudauth
|
| +
|
| +3. Go to the Google APIs Console and create a project (see
|
| + http://code.google.com/apis/console-help/). Then, click
|
| + the "API Access" tab and then the "Create an OAuth2 client
|
| + ID..." button. Enter a product name and click next, select "Web
|
| + application", and then enter the host "http://localhost:8080", and
|
| + click "Create client ID". Then click "Edit settings" and change the
|
| + Authorized Redirect URIs to be http://localhost:8080/auth_return.
|
| + (You'll need to update these values when you move from running
|
| + this app locally to running on App Engine.) Then copy the Client
|
| + ID and Client secret from this dialog into the corresponding values in
|
| + /usr/local/google_appengine/cloudauth/cloudauth.py. Note that these
|
| + values do not enable access until coupled with an OAUTH2 refresh token
|
| + that will be generated by the OAUTH2 flow implemented in this web app -
|
| + so it's safe to save the "secret key" value in your code.
|
| +
|
| +4. Try running it:
|
| + % cd /usr/local/google_appengine
|
| + % ./dev_appserver.py cloudauth
|
| + and then open your browser to http://localhost:8080
|
| +
|
| + If it works, you should see the object loaded.
|
| +
|
| +5. At this point you can upload your app to Google
|
| + infrastructure, following the instructions at
|
| + http://code.google.com/appengine/docs/python/gettingstarted/uploading.html
|
| +
|
| +6. You can see documentation about the OAUTH2 client library at
|
| + http://code.google.com/p/google-api-python-client/wiki/OAuth2
|
|
|