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

Unified Diff: remoting/tools/gettoken.py

Issue 2749004: Token-based authentication for chromoting. (Closed)
Patch Set: - Created 10 years, 6 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 | « remoting/jingle_glue/jingle_test_client.cc ('k') | 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
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()
« no previous file with comments | « remoting/jingle_glue/jingle_test_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698