Index: remoting/tools/gettoken.py |
diff --git a/remoting/tools/gettoken.py b/remoting/tools/gettoken.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..853d09bb2be2b8689ddf35538952181183db9e03 |
--- /dev/null |
+++ b/remoting/tools/gettoken.py |
@@ -0,0 +1,23 @@ |
+#!/usr/bin/env python |
+# |
+# Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+# |
+# gettoken.py can be used to get auth token from Gaia. It asks username and |
+# password and then prints token on the screen. |
+ |
+import urllib |
+import getpass |
+url = "https://www.google.com:443/accounts/ClientLogin" |
+ |
+print "Email:", |
+email = raw_input() |
+ |
+passwd = getpass.getpass("Password: ") |
+ |
+params = urllib.urlencode({'Email': email, 'Passwd': passwd, |
+ 'source': 'chromoting', 'service': 'chromiumsync', |
+ 'PersistentCookie': 'true', 'accountType': 'GOOGLE'}) |
+f = urllib.urlopen(url, params); |
+print f.read() |