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_USER_CONTEXT_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ |
6 #define CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ | 6 #define CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chromeos/chromeos_export.h" | 10 #include "chromeos/chromeos_export.h" |
11 #include "chromeos/login/auth/key.h" | 11 #include "chromeos/login/auth/key.h" |
12 #include "components/user_manager/user_type.h" | 12 #include "components/user_manager/user_type.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
16 // Information that is passed around while authentication is in progress. The | 16 // Information that is passed around while authentication is in progress. The |
17 // credentials may consist of a |user_id_|, |key_| pair or a GAIA |auth_code_|. | 17 // credentials may consist of a |user_id_|, |key_| pair or a GAIA |auth_code_|. |
18 // The |user_id_hash_| is used to locate the user's home directory | 18 // The |user_id_hash_| is used to locate the user's home directory |
19 // mount point for the user. It is set when the mount has been completed. | 19 // mount point for the user. It is set when the mount has been completed. |
20 class CHROMEOS_EXPORT UserContext { | 20 class CHROMEOS_EXPORT UserContext { |
21 public: | 21 public: |
22 // The authentication flow used during sign-in. | 22 // The authentication flow used during sign-in. |
23 enum AuthFlow { | 23 enum AuthFlow { |
24 // Online authentication against GAIA. GAIA did not redirect to a SAML IdP. | 24 // Online authentication against GAIA. GAIA did not redirect to a SAML IdP. |
25 AUTH_FLOW_GAIA_WITHOUT_SAML, | 25 AUTH_FLOW_GAIA_WITHOUT_SAML, |
26 // Online authentication against GAIA. GAIA redirected to a SAML IdP. | 26 // Online authentication against GAIA. GAIA redirected to a SAML IdP. |
27 AUTH_FLOW_GAIA_WITH_SAML, | 27 AUTH_FLOW_GAIA_WITH_SAML, |
28 // Offline authentication against a cached key. | 28 // Offline authentication against a cached key. |
29 AUTH_FLOW_OFFLINE | 29 AUTH_FLOW_OFFLINE, |
| 30 // Offline authentication using and Easy unlock device (e.g. a phone). |
| 31 AUTH_FLOW_EASY_UNLOCK |
30 }; | 32 }; |
31 | 33 |
32 UserContext(); | 34 UserContext(); |
33 UserContext(const UserContext& other); | 35 UserContext(const UserContext& other); |
34 explicit UserContext(const std::string& user_id); | 36 explicit UserContext(const std::string& user_id); |
35 UserContext(user_manager::UserType user_type, const std::string& user_id); | 37 UserContext(user_manager::UserType user_type, const std::string& user_id); |
36 ~UserContext(); | 38 ~UserContext(); |
37 | 39 |
38 bool operator==(const UserContext& context) const; | 40 bool operator==(const UserContext& context) const; |
39 bool operator!=(const UserContext& context) const; | 41 bool operator!=(const UserContext& context) const; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 bool is_using_oauth_; | 73 bool is_using_oauth_; |
72 AuthFlow auth_flow_; | 74 AuthFlow auth_flow_; |
73 user_manager::UserType user_type_; | 75 user_manager::UserType user_type_; |
74 std::string public_session_locale_; | 76 std::string public_session_locale_; |
75 std::string public_session_input_method_; | 77 std::string public_session_input_method_; |
76 }; | 78 }; |
77 | 79 |
78 } // namespace chromeos | 80 } // namespace chromeos |
79 | 81 |
80 #endif // CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ | 82 #endif // CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ |
OLD | NEW |