Class SASLXOauth2Mechanism

  • All Implemented Interfaces:
    Comparable<SASLMechanism>

    public class SASLXOauth2Mechanism
    extends SASLMechanism
    The SASL X-OAUTH2 mechanism as described in https://developers.google .com/talk/jep_extensions/oauth

    The given password will be used as OAUTH token.

    Note that X-OAUTH2 is experimental in Smack. This is because Google defined, besides being a bad practice (XEP-134), custom attributes to the 'auth' stanza, as can be seen here

     
     <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="X-OAUTH2"
        auth:service="chromiumsync" auth:allow-generated-jid="true"
        auth:client-uses-full-bind-result="true" xmlns:auth="http://www.google.com/talk/protocol/auth">
     
     
    from https://developers.google.com/cloud-print/docs/rawxmpp and here
     
     <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl"
       mechanism="X-OAUTH2"
       auth:service="oauth2"
       xmlns:auth="http://www.google.com/talk/protocol/auth">
     base64("\0" + user_name + "\0" + oauth_token)
     </auth>
     
     
    from https://developers.google.com/talk/jep_extensions/oauth

    Those attribute extensions are currently not supported by Smack, and it's unclear how it affects authorization and how widely they are used.