OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/chromeos/login/auth/login_performer.h" | 5 #include "chrome/browser/chromeos/login/auth/login_performer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 SupervisedUserLoginFlow* new_flow = | 230 SupervisedUserLoginFlow* new_flow = |
231 new SupervisedUserLoginFlow(user_context.GetUserID()); | 231 new SupervisedUserLoginFlow(user_context.GetUserID()); |
232 new_flow->set_host( | 232 new_flow->set_host( |
233 UserManager::Get()->GetUserFlow(user_context.GetUserID())->host()); | 233 UserManager::Get()->GetUserFlow(user_context.GetUserID())->host()); |
234 UserManager::Get()->SetUserFlow(user_context.GetUserID(), new_flow); | 234 UserManager::Get()->SetUserFlow(user_context.GetUserID(), new_flow); |
235 | 235 |
236 SupervisedUserAuthentication* authentication = UserManager::Get()-> | 236 SupervisedUserAuthentication* authentication = UserManager::Get()-> |
237 GetSupervisedUserManager()->GetAuthentication(); | 237 GetSupervisedUserManager()->GetAuthentication(); |
238 | 238 |
239 UserContext user_context_copy = | 239 UserContext user_context_copy = authentication->TransformKey(user_context); |
240 authentication->TransformPasswordInContext(user_context); | |
241 | 240 |
242 if (authentication->GetPasswordSchema(user_context.GetUserID()) == | 241 if (authentication->GetPasswordSchema(user_context.GetUserID()) == |
243 SupervisedUserAuthentication::SCHEMA_SALT_HASHED) { | 242 SupervisedUserAuthentication::SCHEMA_SALT_HASHED) { |
244 if (extended_authenticator_.get()) { | 243 if (extended_authenticator_.get()) { |
245 extended_authenticator_->SetConsumer(NULL); | 244 extended_authenticator_->SetConsumer(NULL); |
246 } | 245 } |
247 extended_authenticator_ = new ExtendedAuthenticator(this); | 246 extended_authenticator_ = new ExtendedAuthenticator(this); |
248 // TODO(antrim) : Replace empty callback with explicit method. | 247 // TODO(antrim) : Replace empty callback with explicit method. |
249 // http://crbug.com/351268 | 248 // http://crbug.com/351268 |
250 BrowserThread::PostTask( | 249 BrowserThread::PostTask( |
251 BrowserThread::UI, | 250 BrowserThread::UI, |
252 FROM_HERE, | 251 FROM_HERE, |
253 base::Bind(&ExtendedAuthenticator::AuthenticateToMount, | 252 base::Bind(&ExtendedAuthenticator::AuthenticateToMount, |
254 extended_authenticator_.get(), | 253 extended_authenticator_.get(), |
255 user_context_copy, | 254 user_context_copy, |
256 ExtendedAuthenticator::HashSuccessCallback())); | 255 ExtendedAuthenticator::ResultCallback())); |
257 | 256 |
258 } else { | 257 } else { |
259 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 258 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); |
260 BrowserThread::PostTask( | 259 BrowserThread::PostTask( |
261 BrowserThread::UI, | 260 BrowserThread::UI, |
262 FROM_HERE, | 261 FROM_HERE, |
263 base::Bind(&Authenticator::LoginAsLocallyManagedUser, | 262 base::Bind(&Authenticator::LoginAsLocallyManagedUser, |
264 authenticator_.get(), | 263 authenticator_.get(), |
265 user_context_copy)); | 264 user_context_copy)); |
266 } | 265 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 policy::WildcardLoginChecker::Result result) { | 362 policy::WildcardLoginChecker::Result result) { |
364 if (result == policy::WildcardLoginChecker::RESULT_ALLOWED) { | 363 if (result == policy::WildcardLoginChecker::RESULT_ALLOWED) { |
365 StartLoginCompletion(); | 364 StartLoginCompletion(); |
366 } else { | 365 } else { |
367 if (delegate_) | 366 if (delegate_) |
368 delegate_->WhiteListCheckFailed(user_context_.GetUserID()); | 367 delegate_->WhiteListCheckFailed(user_context_.GetUserID()); |
369 } | 368 } |
370 } | 369 } |
371 | 370 |
372 } // namespace chromeos | 371 } // namespace chromeos |
OLD | NEW |