| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # | |
| 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 # | |
| 7 # gettoken.py can be used to get auth token from Gaia. It asks username and | |
| 8 # password and then prints token on the screen. | |
| 9 | |
| 10 import urllib | |
| 11 import getpass | |
| 12 url = "https://www.google.com:443/accounts/ClientLogin" | |
| 13 | |
| 14 print "Email:", | |
| 15 email = raw_input() | |
| 16 | |
| 17 passwd = getpass.getpass("Password: ") | |
| 18 | |
| 19 params = urllib.urlencode({'Email': email, 'Passwd': passwd, | |
| 20 'source': 'chromoting', 'service': 'chromiumsync', | |
| 21 'PersistentCookie': 'true', 'accountType': 'GOOGLE'}) | |
| 22 f = urllib.urlopen(url, params); | |
| 23 print f.read() | |
| OLD | NEW |