| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ | 5 #ifndef GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ |
| 6 #define GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ | 6 #define GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // Magic string indicating that though the user does not have Less Secure | 47 // Magic string indicating that though the user does not have Less Secure |
| 48 // Apps enabled, the user provided the right password. | 48 // Apps enabled, the user provided the right password. |
| 49 static const char kWebLoginRequired[]; | 49 static const char kWebLoginRequired[]; |
| 50 | 50 |
| 51 // This will later be hidden behind an auth service which caches | 51 // This will later be hidden behind an auth service which caches |
| 52 // tokens. | 52 // tokens. |
| 53 GaiaAuthFetcher(GaiaAuthConsumer* consumer, | 53 GaiaAuthFetcher(GaiaAuthConsumer* consumer, |
| 54 const std::string& source, | 54 const std::string& source, |
| 55 net::URLRequestContextGetter* getter); | 55 net::URLRequestContextGetter* getter); |
| 56 virtual ~GaiaAuthFetcher(); | 56 ~GaiaAuthFetcher() override; |
| 57 | 57 |
| 58 // Start a request to obtain the SID and LSID cookies for the the account | 58 // Start a request to obtain the SID and LSID cookies for the the account |
| 59 // identified by |username| and |password|. If |service| is not null or | 59 // identified by |username| and |password|. If |service| is not null or |
| 60 // empty, then also obtains a service token for specified service. | 60 // empty, then also obtains a service token for specified service. |
| 61 // | 61 // |
| 62 // If this is a second call because of captcha challenge, then the | 62 // If this is a second call because of captcha challenge, then the |
| 63 // |login_token| and |login_captcha| arugment should correspond to the | 63 // |login_token| and |login_captcha| arugment should correspond to the |
| 64 // solution of the challenge. | 64 // solution of the challenge. |
| 65 // | 65 // |
| 66 // Either OnClientLoginSuccess or OnClientLoginFailure will be | 66 // Either OnClientLoginSuccess or OnClientLoginFailure will be |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 // Starts a request to list the accounts in the GAIA cookie. | 186 // Starts a request to list the accounts in the GAIA cookie. |
| 187 void StartListAccounts(); | 187 void StartListAccounts(); |
| 188 | 188 |
| 189 // Starts a request to get the list of URLs to check for connection info. | 189 // Starts a request to get the list of URLs to check for connection info. |
| 190 // Returns token/URL pairs to check, and the resulting status can be given to | 190 // Returns token/URL pairs to check, and the resulting status can be given to |
| 191 // /MergeSession requests. | 191 // /MergeSession requests. |
| 192 void StartGetCheckConnectionInfo(); | 192 void StartGetCheckConnectionInfo(); |
| 193 | 193 |
| 194 // Implementation of net::URLFetcherDelegate | 194 // Implementation of net::URLFetcherDelegate |
| 195 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; | 195 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 196 | 196 |
| 197 // StartClientLogin been called && results not back yet? | 197 // StartClientLogin been called && results not back yet? |
| 198 bool HasPendingFetch(); | 198 bool HasPendingFetch(); |
| 199 | 199 |
| 200 // Stop any URL fetches in progress. | 200 // Stop any URL fetches in progress. |
| 201 void CancelRequest(); | 201 void CancelRequest(); |
| 202 | 202 |
| 203 // From a URLFetcher result, generate an appropriate error. | 203 // From a URLFetcher result, generate an appropriate error. |
| 204 // From the API documentation, both IssueAuthToken and ClientLogin have | 204 // From the API documentation, both IssueAuthToken and ClientLogin have |
| 205 // the same error returns. | 205 // the same error returns. |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); | 433 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); |
| 434 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); | 434 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); |
| 435 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthWithQuote); | 435 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthWithQuote); |
| 436 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); | 436 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); |
| 437 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeQuote); | 437 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeQuote); |
| 438 | 438 |
| 439 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); | 439 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); |
| 440 }; | 440 }; |
| 441 | 441 |
| 442 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ | 442 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ |
| OLD | NEW |