Commit 561abfd5 authored by zelidrag@chromium.org's avatar zelidrag@chromium.org

Made OAuth token verification and user seession cookie retrieval process...

Made OAuth token verification and user seession cookie retrieval process robust on transient network errors. If it fails, this part of the authentication process will retry up to 5 times when we detect that we are online.

BUG=chromium-os:18859, chromium-os:21633
TEST=see the bug

Review URL: http://codereview.chromium.org/8586007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110667 0039d316-1c4b-4281-b951-d872f2087c98
parent 3af441b3
......@@ -54,8 +54,6 @@ LoginPerformer::LoginPerformer(Delegate* delegate)
initial_online_auth_pending_(false),
auth_mode_(AUTH_MODE_INTERNAL),
using_oauth_(
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kWebUILogin) &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSkipOAuthLogin)),
weak_factory_(this) {
......@@ -176,14 +174,9 @@ void LoginPerformer::OnProfileCreated(Profile* profile, Status status) {
return;
}
if (!using_oauth_) {
// Fetch cookies, tokens for the loaded profile only if authentication
// was performed via ClientLogin. We don't need this in the case when
// we use extension + OAuth1 access token check flow.
LoginUtils::Get()->FetchCookies(profile, credentials_);
} else {
if (using_oauth_)
LoginUtils::Get()->StartTokenServices(profile);
}
LoginUtils::Get()->StartSync(profile, credentials_);
credentials_ = GaiaAuthConsumer::ClientLoginResult();
......
......@@ -93,12 +93,6 @@ class LoginUtils {
virtual void RestoreAuthenticationSession(const std::string& user_name,
Profile* profile) = 0;
// Given the credentials try to exchange them for
// full-fledged Google authentication cookies.
virtual void FetchCookies(
Profile* profile,
const GaiaAuthConsumer::ClientLoginResult& credentials) = 0;
// Starts process of fetching OAuth2 tokens (based on OAuth1 tokens found
// in |user_profile|) and kicks off internal services that depend on them.
virtual void StartTokenServices(Profile* user_profile) = 0;
......
......@@ -110,10 +110,6 @@ class MockLoginUtils : public LoginUtils {
virtual void RestoreAuthenticationSession(const std::string& user_name,
Profile* profile) {}
virtual void FetchCookies(
Profile* profile,
const GaiaAuthConsumer::ClientLoginResult& credentials) {}
virtual void StartTokenServices(Profile* profile) {}
virtual void StartSync(
......
......@@ -504,7 +504,6 @@ UserManager::UserManager()
guest_user_(kGuestUser),
stub_user_(kStubUser),
logged_in_user_(NULL),
offline_login_(false),
current_user_is_owner_(false),
current_user_is_new_(false),
user_is_logged_in_(false),
......
......@@ -125,9 +125,6 @@ class UserManager : public ProfileImageDownloader::Delegate,
bool user_is_logged_in() const { return user_is_logged_in_; }
void set_offline_login(bool value) { offline_login_ = value; }
bool offline_login() { return offline_login_; }
// Returns true if we're logged in as a Guest.
bool IsLoggedInAsGuest() const;
......@@ -243,9 +240,6 @@ class UserManager : public ProfileImageDownloader::Delegate,
// In test paths without login points to the |stub_user_| instance.
User* logged_in_user_;
// Current user is logged in offline. Valid only for WebUI login flow.
bool offline_login_;
// Cached flag of whether currently logged-in user is owner or not.
// May be accessed on different threads, requires locking.
bool current_user_is_owner_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment