summaryrefslogtreecommitdiffstats
path: root/remoting/tools
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 16:34:03 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 16:34:03 +0000
commit04906d3ef0c94e1efcb09f57b928c57627467ceb (patch)
tree966b75cde960343c2aedb3785c98d30c59228c8e /remoting/tools
parentbbeb952b65e4d437d0bacf15eeb48de58d3dd457 (diff)
downloadchromium_src-04906d3ef0c94e1efcb09f57b928c57627467ceb.zip
chromium_src-04906d3ef0c94e1efcb09f57b928c57627467ceb.tar.gz
chromium_src-04906d3ef0c94e1efcb09f57b928c57627467ceb.tar.bz2
Update gettoken.py to generate chromoting directory token.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3325005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools')
-rwxr-xr-xremoting/tools/gettoken.py44
1 files changed, 32 insertions, 12 deletions
diff --git a/remoting/tools/gettoken.py b/remoting/tools/gettoken.py
index d066bb8..a36408b 100755
--- a/remoting/tools/gettoken.py
+++ b/remoting/tools/gettoken.py
@@ -13,26 +13,46 @@ import urllib
import gaia_auth
-auth_filepath = os.path.join(os.path.expanduser('~'), '.chromotingAuthToken')
+chromoting_auth_filepath = os.path.join(os.path.expanduser('~'),
+ '.chromotingAuthToken')
+chromoting_dir_auth_filepath = os.path.join(os.path.expanduser('~'),
+ '.chromotingDirectoryAuthToken')
print "Email:",
email = raw_input()
passwd = getpass.getpass("Password: ")
-authenticator = gaia_auth.GaiaAuthenticator('chromiumsync');
-auth_token = authenticator.authenticate(email, passwd)
+chromoting_authenticator = gaia_auth.GaiaAuthenticator('chromiumsync');
+chromoting_auth_token = chromoting_authenticator.authenticate(email, passwd)
-# Set permission mask for created file.
+chromoting_dir_authenticator = gaia_auth.GaiaAuthenticator('chromoting');
+chromoting_dir_auth_token = \
+ chromoting_dir_authenticator.authenticate(email, passwd)
+
+# Set permission mask for created files.
os.umask(0066)
-auth_file = open(auth_filepath, 'w')
-auth_file.write(email)
-auth_file.write('\n')
-auth_file.write(auth_token)
-auth_file.close()
+
+chromoting_auth_file = open(chromoting_auth_filepath, 'w')
+chromoting_auth_file.write(email)
+chromoting_auth_file.write('\n')
+chromoting_auth_file.write(chromoting_auth_token)
+chromoting_auth_file.close()
+
+print
+print 'Chromoting (sync) Auth Token:'
+print
+print chromoting_auth_token
+print '...saved in', chromoting_auth_filepath
+
+chromoting_dir_auth_file = open(chromoting_dir_auth_filepath, 'w')
+chromoting_dir_auth_file.write(email)
+chromoting_dir_auth_file.write('\n')
+chromoting_dir_auth_file.write(chromoting_dir_auth_token)
+chromoting_dir_auth_file.close()
print
-print 'Auth token:'
+print 'Chromoting Directory Auth Token:'
print
-print auth_token
-print '...saved in', auth_filepath
+print chromoting_dir_auth_token
+print '...saved in', chromoting_dir_auth_filepath