Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: jingle/notifier/communicator/gaia_token_pre_xmpp_auth.cc

Issue 6649006: Added support for other authentication mechanisms in jingle. This will allow ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Lint error fixed Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: jingle/notifier/communicator/gaia_token_pre_xmpp_auth.cc
===================================================================
--- jingle/notifier/communicator/gaia_token_pre_xmpp_auth.cc (revision 77157)
+++ jingle/notifier/communicator/gaia_token_pre_xmpp_auth.cc (working copy)
@@ -52,10 +52,17 @@
GaiaTokenPreXmppAuth::GaiaTokenPreXmppAuth(
const std::string& username,
const std::string& token,
- const std::string& token_service)
+ const std::string& token_service,
+ const std::string& auth_mechanism)
: username_(username),
token_(token),
- token_service_(token_service) { }
+ token_service_(token_service),
+ auth_mechanism_(auth_mechanism) {
+ // For backward compatibility, default to kGaiaAuthMechanism if a mechanism
akalin 2011/03/08 23:45:56 Hmm, I'd rather expose the default gaia auth mecha
sanjeevr 2011/03/09 00:54:44 Done.
+ // is not specified.
+ if (auth_mechanism_.empty())
+ auth_mechanism_ = kGaiaAuthMechanism;
+}
GaiaTokenPreXmppAuth::~GaiaTokenPreXmppAuth() { }
@@ -94,16 +101,16 @@
std::string GaiaTokenPreXmppAuth::ChooseBestSaslMechanism(
const std::vector<std::string> & mechanisms, bool encrypted) {
return (std::find(mechanisms.begin(),
- mechanisms.end(), kGaiaAuthMechanism) !=
- mechanisms.end()) ? kGaiaAuthMechanism : "";
+ mechanisms.end(), auth_mechanism_) !=
+ mechanisms.end()) ? auth_mechanism_ : "";
}
buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism(
const std::string& mechanism) {
- if (mechanism != kGaiaAuthMechanism)
- return NULL;
- return new GaiaCookieMechanism(
- kGaiaAuthMechanism, username_, token_, token_service_);
+ if (mechanism == auth_mechanism_)
+ return new GaiaCookieMechanism(
+ mechanism, username_, token_, token_service_);
+ return NULL;
}
} // namespace notifier

Powered by Google App Engine
This is Rietveld 408576698