def build_xoauth_string(url, consumer, token=None):
    request = Request.from_consumer_and_token(consumer, token,
        "GET", url)

    signing_method = SignatureMethod_HMAC_SHA1()
    request.sign_request(signing_method, consumer, token)

    params = []
    for k, v in sorted(request.iteritems()):
        if v is not None:
            params.append('%s="%s"' % (k, escape(v)))

    return "%s %s %s" % ("GET", url, ','.join(params))
Build an XOAUTH string for use in SMTP/IMPA authentication.
dataset/ETHPy150Open ibagrak/algae/gae/libs/oauth2/__init__.py/build_xoauth_string