Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Unified Diff: remoting/tools/gettoken.py

Issue 3325005: Update gettoken.py to generate chromoting directory token. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: reindent Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/tools/gettoken.py
diff --git a/remoting/tools/gettoken.py b/remoting/tools/gettoken.py
index d066bb8aa3d6404027aec8d5db86b4647c73b6ad..a36408bd009b8ccc5cabf6a0fe2a18e024213769 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698