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

Side by Side Diff: chrome/browser/chromeos/login/google_authenticator.h

Issue 4980005: Allow sync with 2-factor StrongAuth accounts in ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Linux compile fix. Created 10 years, 1 month 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 const std::string& old_password, 93 const std::string& old_password,
94 const GaiaAuthConsumer::ClientLoginResult& credentials); 94 const GaiaAuthConsumer::ClientLoginResult& credentials);
95 void ResyncEncryptedData( 95 void ResyncEncryptedData(
96 const GaiaAuthConsumer::ClientLoginResult& credentials); 96 const GaiaAuthConsumer::ClientLoginResult& credentials);
97 void RetryAuth(Profile* profile, 97 void RetryAuth(Profile* profile,
98 const std::string& username, 98 const std::string& username,
99 const std::string& password, 99 const std::string& password,
100 const std::string& login_token, 100 const std::string& login_token,
101 const std::string& login_captcha); 101 const std::string& login_captcha);
102 102
103 const GoogleServiceAuthError& last_error() { return last_error_; }
Chris Masone 2010/11/17 01:11:09 You can get rid of this if you take the approach I
104
103 // Callbacks from GaiaAuthFetcher 105 // Callbacks from GaiaAuthFetcher
104 virtual void OnClientLoginFailure( 106 virtual void OnClientLoginFailure(
105 const GoogleServiceAuthError& error); 107 const GoogleServiceAuthError& error);
106 virtual void OnClientLoginSuccess( 108 virtual void OnClientLoginSuccess(
107 const GaiaAuthConsumer::ClientLoginResult& credentials); 109 const GaiaAuthConsumer::ClientLoginResult& credentials);
108 110
109 private: 111 private:
110 112
111 // If we don't have the system salt yet, loads it from the CryptohomeLibrary. 113 // If we don't have the system salt yet, loads it from the CryptohomeLibrary.
112 void LoadSystemSalt(); 114 void LoadSystemSalt();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 192
191 std::string ascii_hash_; 193 std::string ascii_hash_;
192 chromeos::CryptohomeBlob system_salt_; 194 chromeos::CryptohomeBlob system_salt_;
193 bool unlock_; // True if authenticating to unlock the computer. 195 bool unlock_; // True if authenticating to unlock the computer.
194 bool try_again_; // True if we're willing to retry the login attempt. 196 bool try_again_; // True if we're willing to retry the login attempt.
195 197
196 std::string localaccount_; 198 std::string localaccount_;
197 bool checked_for_localaccount_; // needed because empty localaccount_ is ok. 199 bool checked_for_localaccount_; // needed because empty localaccount_ is ok.
198 Lock localaccount_lock_; // a lock around checked_for_localaccount_. 200 Lock localaccount_lock_; // a lock around checked_for_localaccount_.
199 201
202 GoogleServiceAuthError last_error_;
203
200 friend class GoogleAuthenticatorTest; 204 friend class GoogleAuthenticatorTest;
201 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, SaltToAscii); 205 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, SaltToAscii);
202 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, CheckTwoFactorResponse); 206 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, CheckTwoFactorResponse);
203 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, CheckNormalErrorCode); 207 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, CheckNormalErrorCode);
204 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, EmailAddressNoOp); 208 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, EmailAddressNoOp);
205 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, EmailAddressIgnoreCaps); 209 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, EmailAddressIgnoreCaps);
206 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, 210 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest,
207 EmailAddressIgnoreDomainCaps); 211 EmailAddressIgnoreDomainCaps);
208 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, 212 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest,
209 EmailAddressIgnoreOneUsernameDot); 213 EmailAddressIgnoreOneUsernameDot);
(...skipping 15 matching lines...) Expand all
225 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginNetFailure); 229 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginNetFailure);
226 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginDenied); 230 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, LoginDenied);
227 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, TwoFactorLogin); 231 FRIEND_TEST_ALL_PREFIXES(GoogleAuthenticatorTest, TwoFactorLogin);
228 232
229 DISALLOW_COPY_AND_ASSIGN(GoogleAuthenticator); 233 DISALLOW_COPY_AND_ASSIGN(GoogleAuthenticator);
230 }; 234 };
231 235
232 } // namespace chromeos 236 } // namespace chromeos
233 237
234 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_ 238 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_GOOGLE_AUTHENTICATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698