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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 virtual void ResyncEncryptedData( | 83 virtual void ResyncEncryptedData( |
84 const GaiaAuthConsumer::ClientLoginResult& credentials) = 0; | 84 const GaiaAuthConsumer::ClientLoginResult& credentials) = 0; |
85 | 85 |
86 // Attempt to authenticate online again. | 86 // Attempt to authenticate online again. |
87 virtual void RetryAuth(Profile* profile, | 87 virtual void RetryAuth(Profile* profile, |
88 const std::string& username, | 88 const std::string& username, |
89 const std::string& password, | 89 const std::string& password, |
90 const std::string& login_token, | 90 const std::string& login_token, |
91 const std::string& login_captcha) = 0; | 91 const std::string& login_captcha) = 0; |
92 | 92 |
93 // Kicks of verification of OAuth1 access token. | |
94 virtual void VerifyOAuth1AccessToken(const std::string& oauth1_access_token, | |
95 const std::string& oauth1_secret) = 0; | |
96 | |
97 // OAuth token encryption helpers. | |
98 virtual std::string EncryptToken(const std::string& token) = 0; | |
99 virtual std::string DecryptToken(const std::string& encrypted_token) = 0; | |
100 | |
101 // Profile (usually off the record ) that was used to perform the last | 93 // Profile (usually off the record ) that was used to perform the last |
102 // authentication process. | 94 // authentication process. |
103 Profile* authentication_profile() { return authentication_profile_; } | 95 Profile* authentication_profile() { return authentication_profile_; } |
104 | 96 |
105 // Perform basic canonicalization of |email_address|, taking into account | 97 // Perform basic canonicalization of |email_address|, taking into account |
106 // that gmail does not consider '.' or caps inside a username to matter. | 98 // that gmail does not consider '.' or caps inside a username to matter. |
107 // It also ignores everything after a '+'. | 99 // It also ignores everything after a '+'. |
108 // For example, c.masone+abc@gmail.com == cMaSone@gmail.com, per | 100 // For example, c.masone+abc@gmail.com == cMaSone@gmail.com, per |
109 // http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=10313# | 101 // http://mail.google.com/support/bin/answer.py?hl=en&ctx=mail&answer=10313# |
110 static std::string Canonicalize(const std::string& email_address); | 102 static std::string Canonicalize(const std::string& email_address); |
111 | 103 |
112 protected: | 104 protected: |
113 LoginStatusConsumer* consumer_; | 105 LoginStatusConsumer* consumer_; |
114 Profile* authentication_profile_; | 106 Profile* authentication_profile_; |
115 | 107 |
116 private: | 108 private: |
117 DISALLOW_COPY_AND_ASSIGN(Authenticator); | 109 DISALLOW_COPY_AND_ASSIGN(Authenticator); |
118 }; | 110 }; |
119 | 111 |
120 } // namespace chromeos | 112 } // namespace chromeos |
121 | 113 |
122 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 114 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
OLD | NEW |