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

Side by Side Diff: remoting/tools/me2me_virtual_host.py

Issue 10831089: [Chromoting] Make virtual Me2Me explicitly ask for an app-specific password. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Virtual Me2Me implementation. This script runs and manages the processes 6 # Virtual Me2Me implementation. This script runs and manages the processes
7 # required for a Virtual Me2Me desktop, which are: X server, X desktop 7 # required for a Virtual Me2Me desktop, which are: X server, X desktop
8 # session, and Host process. 8 # session, and Host process.
9 # This script is intended to run continuously as a background daemon 9 # This script is intended to run continuously as a background daemon
10 # process, running under an ordinary (non-root) user account. 10 # process, running under an ordinary (non-root) user account.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 def generate_tokens(self): 87 def generate_tokens(self):
88 """Prompt for username/password and use them to generate new authentication 88 """Prompt for username/password and use them to generate new authentication
89 tokens. 89 tokens.
90 90
91 Raises: 91 Raises:
92 Exception: Failed to get new authentication tokens. 92 Exception: Failed to get new authentication tokens.
93 """ 93 """
94 print "Email:", 94 print "Email:",
95 self.login = raw_input() 95 self.login = raw_input()
96 password = getpass.getpass("Password: ") 96 password = getpass.getpass("App-specific password: ")
97 97
98 chromoting_auth = gaia_auth.GaiaAuthenticator('chromoting') 98 chromoting_auth = gaia_auth.GaiaAuthenticator('chromoting')
99 self.chromoting_auth_token = chromoting_auth.authenticate(self.login, 99 self.chromoting_auth_token = chromoting_auth.authenticate(self.login,
100 password) 100 password)
101 101
102 xmpp_authenticator = gaia_auth.GaiaAuthenticator('chromiumsync') 102 xmpp_authenticator = gaia_auth.GaiaAuthenticator('chromiumsync')
103 self.xmpp_auth_token = xmpp_authenticator.authenticate(self.login, 103 self.xmpp_auth_token = xmpp_authenticator.authenticate(self.login,
104 password) 104 password)
105 105
106 def load_config(self): 106 def load_config(self):
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 os.remove(host.config_file) 847 os.remove(host.config_file)
848 return 0 848 return 0
849 elif os.WEXITSTATUS(status) == 4: 849 elif os.WEXITSTATUS(status) == 4:
850 logging.info("OAuth credentials are invalid - exiting.") 850 logging.info("OAuth credentials are invalid - exiting.")
851 os.remove(auth.config_file) 851 os.remove(auth.config_file)
852 return 0 852 return 0
853 853
854 if __name__ == "__main__": 854 if __name__ == "__main__":
855 logging.basicConfig(level=logging.DEBUG) 855 logging.basicConfig(level=logging.DEBUG)
856 sys.exit(main()) 856 sys.exit(main())
OLDNEW
« 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