summaryrefslogtreecommitdiffstats
path: root/remoting/tools
diff options
context:
space:
mode:
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