OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 const std::string& login_token, | 93 const std::string& login_token, |
94 const std::string& login_captcha) = 0; | 94 const std::string& login_captcha) = 0; |
95 | 95 |
96 // Kicks of verification of OAuth1 access token. | 96 // Kicks of verification of OAuth1 access token. |
97 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, | 97 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, |
98 const std::string& oauth1_secret) = 0; | 98 const std::string& oauth1_secret) = 0; |
99 | 99 |
100 // OAuth token encryption helpers. | 100 // OAuth token encryption helpers. |
101 virtual std::string EncryptToken(const std::string& token) = 0; | 101 virtual std::string EncryptToken(const std::string& token) = 0; |
102 virtual std::string DecryptToken(const std::string& encrypted_token) = 0; | 102 virtual std::string DecryptToken(const std::string& encrypted_token) = 0; |
| 103 // TODO(zelidrag): Remove legacy encryption support in R16. |
| 104 virtual std::string DecryptLegacyToken( |
| 105 const std::string& encrypted_token) = 0; |
103 | 106 |
104 // Profile (usually off the record ) that was used to perform the last | 107 // Profile (usually off the record ) that was used to perform the last |
105 // authentication process. | 108 // authentication process. |
106 Profile* authentication_profile() { return authentication_profile_; } | 109 Profile* authentication_profile() { return authentication_profile_; } |
107 | 110 |
108 // Perform basic canonicalization of |email_address|, taking into account | 111 // Perform basic canonicalization of |email_address|, taking into account |
109 // that gmail does not consider '.' or caps inside a username to matter. | 112 // that gmail does not consider '.' or caps inside a username to matter. |
110 // It also ignores everything after a '+'. | 113 // It also ignores everything after a '+'. |
111 // For example, c.masone+abc@gmail.com == cMaSone@gmail.com, per | 114 // For example, c.masone+abc@gmail.com == cMaSone@gmail.com, per |
112 // http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=10313# | 115 // http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=10313# |
113 static std::string Canonicalize(const std::string& email_address); | 116 static std::string Canonicalize(const std::string& email_address); |
114 | 117 |
115 protected: | 118 protected: |
116 LoginStatusConsumer* consumer_; | 119 LoginStatusConsumer* consumer_; |
117 Profile* authentication_profile_; | 120 Profile* authentication_profile_; |
118 | 121 |
119 private: | 122 private: |
120 DISALLOW_COPY_AND_ASSIGN(Authenticator); | 123 DISALLOW_COPY_AND_ASSIGN(Authenticator); |
121 }; | 124 }; |
122 | 125 |
123 } // namespace chromeos | 126 } // namespace chromeos |
124 | 127 |
125 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 128 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
OLD | NEW |