| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PARALLEL_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE; | 144 const GaiaAuthConsumer::ClientLoginResult& credentials) OVERRIDE; |
| 145 virtual void RetryAuth(Profile* profile, | 145 virtual void RetryAuth(Profile* profile, |
| 146 const std::string& username, | 146 const std::string& username, |
| 147 const std::string& password, | 147 const std::string& password, |
| 148 const std::string& login_token, | 148 const std::string& login_token, |
| 149 const std::string& login_captcha) OVERRIDE; | 149 const std::string& login_captcha) OVERRIDE; |
| 150 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, | 150 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, |
| 151 const std::string& oauth1_secret) OVERRIDE; | 151 const std::string& oauth1_secret) OVERRIDE; |
| 152 virtual std::string EncryptToken(const std::string& token) OVERRIDE; | 152 virtual std::string EncryptToken(const std::string& token) OVERRIDE; |
| 153 virtual std::string DecryptToken(const std::string& encrypted_token) OVERRIDE; | 153 virtual std::string DecryptToken(const std::string& encrypted_token) OVERRIDE; |
| 154 virtual std::string DecryptLegacyToken( | |
| 155 const std::string& encrypted_token) OVERRIDE; | |
| 156 | 154 |
| 157 // AuthAttemptStateResolver overrides. | 155 // AuthAttemptStateResolver overrides. |
| 158 // Attempts to make a decision and call back |consumer_| based on | 156 // Attempts to make a decision and call back |consumer_| based on |
| 159 // the state we have gathered at the time of call. If a decision | 157 // the state we have gathered at the time of call. If a decision |
| 160 // can't be made, defers until the next time this is called. | 158 // can't be made, defers until the next time this is called. |
| 161 // When a decision is made, will call back to |consumer_| on the UI thread. | 159 // When a decision is made, will call back to |consumer_| on the UI thread. |
| 162 // | 160 // |
| 163 // Must be called on the IO thread. | 161 // Must be called on the IO thread. |
| 164 virtual void Resolve() OVERRIDE; | 162 virtual void Resolve() OVERRIDE; |
| 165 | 163 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 238 |
| 241 // Records OAuth1 access token verification failure for |user_account|. | 239 // Records OAuth1 access token verification failure for |user_account|. |
| 242 void RecordOAuthCheckFailure(const std::string& user_account); | 240 void RecordOAuthCheckFailure(const std::string& user_account); |
| 243 | 241 |
| 244 // Stores a hash of |password|, salted with the ascii of |system_salt_|. | 242 // Stores a hash of |password|, salted with the ascii of |system_salt_|. |
| 245 std::string HashPassword(const std::string& password); | 243 std::string HashPassword(const std::string& password); |
| 246 | 244 |
| 247 // Returns the ascii encoding of the system salt. | 245 // Returns the ascii encoding of the system salt. |
| 248 std::string SaltAsAscii(); | 246 std::string SaltAsAscii(); |
| 249 | 247 |
| 250 // Returns the ascii encoding of user supplemental key. | |
| 251 // TODO(zelidrag): http://crosbug.com/18905. Replace this with a key from | |
| 252 // nssdb instead. | |
| 253 std::string UserSupplementalKeyAsAscii(); | |
| 254 | |
| 255 // Signal login completion status for cases when a new user is added via | 248 // Signal login completion status for cases when a new user is added via |
| 256 // an external authentication provider (i.e. GAIA extension). | 249 // an external authentication provider (i.e. GAIA extension). |
| 257 void ResolveLoginCompletionStatus(); | 250 void ResolveLoginCompletionStatus(); |
| 258 | 251 |
| 259 // Name of a file, next to chrome, that contains a local account username. | 252 // Name of a file, next to chrome, that contains a local account username. |
| 260 static const char kLocalaccountFile[]; | 253 static const char kLocalaccountFile[]; |
| 261 | 254 |
| 262 // Milliseconds until we timeout our attempt to hit ClientLogin. | 255 // Milliseconds until we timeout our attempt to hit ClientLogin. |
| 263 static const int kClientLoginTimeoutMs; | 256 static const int kClientLoginTimeoutMs; |
| 264 | 257 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount); | 298 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadLocalaccount); |
| 306 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, | 299 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, |
| 307 ReadLocalaccountTrailingWS); | 300 ReadLocalaccountTrailingWS); |
| 308 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount); | 301 FRIEND_TEST_ALL_PREFIXES(ParallelAuthenticatorTest, ReadNoLocalaccount); |
| 309 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); | 302 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); |
| 310 }; | 303 }; |
| 311 | 304 |
| 312 } // namespace chromeos | 305 } // namespace chromeos |
| 313 | 306 |
| 314 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 307 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| OLD | NEW |