OLD | NEW |
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 Loading... |
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 Loading... |
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()) |
OLD | NEW |