buffet: XMPP client should be looking for X-OAUTH2 auth method
We are using OAuth2 for as SASL method in XMPP, however the state
machine code was explicitly looking for X-GOOGLE-TOKEN which is wrong.
Since we are using OAuth2 we should be looking for X-OAUTH2 method.
BUG=None
TEST=`FEATURES=test emerge-link buffet`
Change-Id: I5c3822ecb9b369d144075bebc0e08420bdb89e6f
Reviewed-on: https://chromium-review.googlesource.com/272911
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/notification/xmpp_channel.cc b/buffet/notification/xmpp_channel.cc
index 75c8004..e2839c5 100644
--- a/buffet/notification/xmpp_channel.cc
+++ b/buffet/notification/xmpp_channel.cc
@@ -158,7 +158,7 @@
if (stanza->name() == "stream:features") {
auto children = stanza->FindChildren("mechanisms/mechanism", false);
for (const auto& child : children) {
- if (child->text() == "X-GOOGLE-TOKEN") {
+ if (child->text() == "X-OAUTH2") {
state_ = XmppState::kAuthenticationStarted;
SendMessage(BuildXmppAuthenticateCommand(account_, access_token_));
return;