| 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 #ifndef CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ |
| 6 #define CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ | 6 #define CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 CREATE_NEW = 6, // Need to create cryptohome for a new user. | 69 CREATE_NEW = 6, // Need to create cryptohome for a new user. |
| 70 RECOVER_MOUNT = 7, // After RecoverEncryptedData, mount cryptohome. | 70 RECOVER_MOUNT = 7, // After RecoverEncryptedData, mount cryptohome. |
| 71 POSSIBLE_PW_CHANGE = 8, // Offline login failed, user may have changed pw. | 71 POSSIBLE_PW_CHANGE = 8, // Offline login failed, user may have changed pw. |
| 72 NEED_NEW_PW = 9, // Obsolete (ClientLogin): user changed pw, | 72 NEED_NEW_PW = 9, // Obsolete (ClientLogin): user changed pw, |
| 73 // we have the old one. | 73 // we have the old one. |
| 74 NEED_OLD_PW = 10, // User changed pw, and we have the new one | 74 NEED_OLD_PW = 10, // User changed pw, and we have the new one |
| 75 // (GAIA auth is OK). | 75 // (GAIA auth is OK). |
| 76 HAVE_NEW_PW = 11, // Obsolete (ClientLogin): We have verified new pw, | 76 HAVE_NEW_PW = 11, // Obsolete (ClientLogin): We have verified new pw, |
| 77 // time to migrate key. | 77 // time to migrate key. |
| 78 OFFLINE_LOGIN = 12, // Login succeeded offline. | 78 OFFLINE_LOGIN = 12, // Login succeeded offline. |
| 79 DEMO_LOGIN = 13, // Logged in as the demo user. | 79 ONLINE_LOGIN = 13, // Offline and online login succeeded. |
| 80 ONLINE_LOGIN = 14, // Offline and online login succeeded. | 80 UNLOCK = 14, // Screen unlock succeeded. |
| 81 UNLOCK = 15, // Screen unlock succeeded. | 81 ONLINE_FAILED = 15, // Obsolete (ClientLogin): Online login disallowed, |
| 82 ONLINE_FAILED = 16, // Obsolete (ClientLogin): Online login disallowed, | |
| 83 // but offline succeeded. | 82 // but offline succeeded. |
| 84 GUEST_LOGIN = 17, // Logged in guest mode. | 83 GUEST_LOGIN = 16, // Logged in guest mode. |
| 85 PUBLIC_ACCOUNT_LOGIN = 18, // Logged into a public account. | 84 PUBLIC_ACCOUNT_LOGIN = 17, // Logged into a public account. |
| 86 SUPERVISED_USER_LOGIN = 19, // Logged in as a supervised user. | 85 SUPERVISED_USER_LOGIN = 18, // Logged in as a supervised user. |
| 87 LOGIN_FAILED = 20, // Login denied. | 86 LOGIN_FAILED = 19, // Login denied. |
| 88 OWNER_REQUIRED = 21, // Login is restricted to the owner only. | 87 OWNER_REQUIRED = 20, // Login is restricted to the owner only. |
| 89 FAILED_USERNAME_HASH = 22, // Failed GetSanitizedUsername request. | 88 FAILED_USERNAME_HASH = 21, // Failed GetSanitizedUsername request. |
| 90 KIOSK_ACCOUNT_LOGIN = 23, // Logged into a kiosk account. | 89 KIOSK_ACCOUNT_LOGIN = 22, // Logged into a kiosk account. |
| 91 REMOVED_DATA_AFTER_FAILURE = 24, // Successfully removed the user's | 90 REMOVED_DATA_AFTER_FAILURE = 23, // Successfully removed the user's |
| 92 // cryptohome after a login failure. | 91 // cryptohome after a login failure. |
| 93 }; | 92 }; |
| 94 | 93 |
| 95 CryptohomeAuthenticator(scoped_refptr<base::TaskRunner> task_runner, | 94 CryptohomeAuthenticator(scoped_refptr<base::TaskRunner> task_runner, |
| 96 AuthStatusConsumer* consumer); | 95 AuthStatusConsumer* consumer); |
| 97 | 96 |
| 98 // Authenticator overrides. | 97 // Authenticator overrides. |
| 99 virtual void CompleteLogin(content::BrowserContext* context, | 98 virtual void CompleteLogin(content::BrowserContext* context, |
| 100 const UserContext& user_context) override; | 99 const UserContext& user_context) override; |
| 101 | 100 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 114 // user_context. This will never contact the server even if it's online. | 113 // user_context. This will never contact the server even if it's online. |
| 115 // The auth result is sent to AuthStatusConsumer in a same way as | 114 // The auth result is sent to AuthStatusConsumer in a same way as |
| 116 // AuthenticateToLogin does. | 115 // AuthenticateToLogin does. |
| 117 virtual void AuthenticateToUnlock(const UserContext& user_context) override; | 116 virtual void AuthenticateToUnlock(const UserContext& user_context) override; |
| 118 | 117 |
| 119 // Initiates supervised user login. | 118 // Initiates supervised user login. |
| 120 // Creates cryptohome if missing or mounts existing one and | 119 // Creates cryptohome if missing or mounts existing one and |
| 121 // notifies consumer on the success/failure. | 120 // notifies consumer on the success/failure. |
| 122 virtual void LoginAsSupervisedUser(const UserContext& user_context) override; | 121 virtual void LoginAsSupervisedUser(const UserContext& user_context) override; |
| 123 | 122 |
| 124 // Initiates retail mode login. | |
| 125 // Mounts tmpfs and notifies consumer on the success/failure. | |
| 126 virtual void LoginRetailMode() override; | |
| 127 | |
| 128 // Initiates incognito ("browse without signing in") login. | 123 // Initiates incognito ("browse without signing in") login. |
| 129 // Mounts tmpfs and notifies consumer on the success/failure. | 124 // Mounts tmpfs and notifies consumer on the success/failure. |
| 130 virtual void LoginOffTheRecord() override; | 125 virtual void LoginOffTheRecord() override; |
| 131 | 126 |
| 132 // Initiates login into a public session. | 127 // Initiates login into a public session. |
| 133 // Mounts an ephemeral cryptohome and notifies consumer on the | 128 // Mounts an ephemeral cryptohome and notifies consumer on the |
| 134 // success/failure. | 129 // success/failure. |
| 135 virtual void LoginAsPublicSession(const UserContext& user_context) override; | 130 virtual void LoginAsPublicSession(const UserContext& user_context) override; |
| 136 | 131 |
| 137 // Initiates login into the kiosk mode account identified by |app_user_id|. | 132 // Initiates login into the kiosk mode account identified by |app_user_id|. |
| 138 // Mounts an ephemeral guest cryptohome if |use_guest_mount| is |true|. | 133 // Mounts an ephemeral guest cryptohome if |use_guest_mount| is |true|. |
| 139 // Otherwise, mounts a public cryptohome, which will be ephemeral if the | 134 // Otherwise, mounts a public cryptohome, which will be ephemeral if the |
| 140 // |DeviceEphemeralUsersEnabled| policy is enabled and non-ephemeral | 135 // |DeviceEphemeralUsersEnabled| policy is enabled and non-ephemeral |
| 141 // otherwise. | 136 // otherwise. |
| 142 virtual void LoginAsKioskAccount(const std::string& app_user_id, | 137 virtual void LoginAsKioskAccount(const std::string& app_user_id, |
| 143 bool use_guest_mount) override; | 138 bool use_guest_mount) override; |
| 144 | 139 |
| 145 // These methods must be called on the UI thread, as they make DBus calls | 140 // These methods must be called on the UI thread, as they make DBus calls |
| 146 // and also call back to the login UI. | 141 // and also call back to the login UI. |
| 147 virtual void OnRetailModeAuthSuccess() override; | |
| 148 virtual void OnAuthSuccess() override; | 142 virtual void OnAuthSuccess() override; |
| 149 virtual void OnAuthFailure(const AuthFailure& error) override; | 143 virtual void OnAuthFailure(const AuthFailure& error) override; |
| 150 virtual void RecoverEncryptedData(const std::string& old_password) override; | 144 virtual void RecoverEncryptedData(const std::string& old_password) override; |
| 151 virtual void ResyncEncryptedData() override; | 145 virtual void ResyncEncryptedData() override; |
| 152 | 146 |
| 153 // AuthAttemptStateResolver overrides. | 147 // AuthAttemptStateResolver overrides. |
| 154 // Attempts to make a decision and call back |consumer_| based on | 148 // Attempts to make a decision and call back |consumer_| based on |
| 155 // the state we have gathered at the time of call. If a decision | 149 // the state we have gathered at the time of call. If a decision |
| 156 // can't be made, defers until the next time this is called. | 150 // can't be made, defers until the next time this is called. |
| 157 // When a decision is made, will call back to |consumer_| on the UI thread. | 151 // When a decision is made, will call back to |consumer_| on the UI thread. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // When |remove_user_data_on_failure_| is set, we delay calling | 257 // When |remove_user_data_on_failure_| is set, we delay calling |
| 264 // consumer_->OnAuthFailure() until we removed the user cryptohome. | 258 // consumer_->OnAuthFailure() until we removed the user cryptohome. |
| 265 const AuthFailure* delayed_login_failure_; | 259 const AuthFailure* delayed_login_failure_; |
| 266 | 260 |
| 267 DISALLOW_COPY_AND_ASSIGN(CryptohomeAuthenticator); | 261 DISALLOW_COPY_AND_ASSIGN(CryptohomeAuthenticator); |
| 268 }; | 262 }; |
| 269 | 263 |
| 270 } // namespace chromeos | 264 } // namespace chromeos |
| 271 | 265 |
| 272 #endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ | 266 #endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ |
| OLD | NEW |