From: Seth Woodworth Date: Wed, 23 Jan 2013 03:43:53 +0000 (-0500) Subject: adding documentation on authenticating a karmaworld instance against google drive X-Git-Tag: release-20150131~551^2~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2c7f3dc7ae3426f02ed199d9c36877865f6ab46c;p=oweals%2Fkarmaworld.git adding documentation on authenticating a karmaworld instance against google drive --- diff --git a/docs/source/gdrive.rst b/docs/source/gdrive.rst new file mode 100644 index 0000000..12ccfa4 --- /dev/null +++ b/docs/source/gdrive.rst @@ -0,0 +1,33 @@ +Google Drive Authentication +=========================== + +Authorizing a new installation of Karmaworld with Google Drive is a convoluted +process. +But it happens infrequently enough that we haven't simplified the process. +This should probably happen in the future, +but in the meantime we can document the process. + +Start a django interactive shell +Import the `karmaworld.apps.notes.gdrive` module. +build a flow object called `flow` +open a private browsing instance in a browser +Log into the google drive account of the GOOGLE_USER set in `karmaworld.secrets.drive` +get the authorization url + flow.step1_authorize_url() + +go to that url in your browser +it will redirecto you to a url in the format of: + ...?code=EXCHANGE_CODE +take the EXCHANGE_CODE and feed it as a string to + credentials = flow.step2_exchange('EXCHANGE_CODE') +This gives you a credentials object, keep this value +Create an instance of DriveAuth() + from karmaworld.apps.notes.models import DriveAuth + auth = DriveAuth() +and feed the credentials object to it with store() + auth.store(credentials) +This will save the DriveAuth() + +You are now authenticated! + +