lukeweber / webrtc-jingle-client

Webrtc audio + jingle protocol brought to IOS and Android.
https://groups.google.com/forum/?fromgroups#!forum/webrtc-jingle
BSD 3-Clause "New" or "Revised" License
335 stars 137 forks source link

Allow logging into google or standards xmpp server at runtime, not compile #73

Closed lukeweber closed 11 years ago

lukeweber commented 11 years ago

third_party/libjingle//talk/xmpp/xmpplogintask.cc:225:#ifndef XMPP_COMPATIBILITY

#ifndef XMPP_COMPATIBILITY
        if (allowNonGoogleLogin_) {
          // Setting the following two attributes is required to support
          // non-google ids.

          // Allow login with non-google id accounts.
          auth->SetAttr(QN_GOOGLE_ALLOW_NON_GOOGLE_ID_XMPP_LOGIN, "true");

          // Allow login with either the non-google id or the friendly email.
          auth->SetAttr(QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT, "true");
        }
#endif

Rough stack that you have to pass through: client/voiceclient.cc -> login(...) client/clientsignalingthread.cc -> sppump->DoLogin(xcs); client/txmpppump.cc -> DoLogin(..) { client->connect(xcs...); } talk/xmpp/xmppclient.cc talk/xmpp/xmppengineimpl.cc talk/xmpp/xmpplogintask.cc

Probably the easiest way is to set isGoogleXmpp(new field) into xcs (XmppClientSettings) and then pass is through the client to the engine, and maybe pass it as a param directly into xmpplogintask. Currently logintask is default constructed with true inside the xmppengineimpl.cc. The param would make it seem that this means all clients could use this library. In my testing, these google specific extras on the bind will cause a standards compliant xmpp server to possibly fail, because they're attributes that are specific to google.

jreyes commented 11 years ago

Where could I open an account for a server that uses this configuration to try to see if i tackle this?

lukeweber commented 11 years ago

Google uses it I think to allow you to login to gmail with an address that doesn't end in gmail.

However if these custom stanza attributes are there it fails on some other servers. Ejabberd server on an older version will definitely fail and I assume a new one might as well.

Jabber.org you can sign up for a free account and it might refuse the connection but haven't tested it.

lukeweber commented 11 years ago

Resolved in 1ea087b2641cbb9a42bf4ebb33d7560cb2a4d0eb and https://github.com/lukeweber/libjingle-override/commit/830b5f54856ccadebf0f39eb826129f4b9dbbe25