def to_header(self, realm=''):
"""Serialize as a header for an HTTPAuth request."""
auth_header = 'OAuth realm="%s"' % realm
# Add the oauth parameters.
if self.parameters:
for k, v in self.parameters.iteritems():
if k[:6] == 'oauth_' or k == "scope":
auth_header += ', %s="%s"' % (k, escape(str(v)))
return {'Authorization': auth_header}
Should be
def to_header(self, realm=''):
"""Serialize as a header for an HTTPAuth request."""
auth_header = 'OAuth realm="%s"' % realm
# Add the oauth parameters.
if self.parameters:
for k, v in self.parameters.iteritems():
auth_header += ', %s="%s"' % (k, escape(str(v)))
return {'Authorization': auth_header}
Otherwise if the provider uses special parameters that don't begin with
oauth_ they will never be sent. Found this trying to auth against youtube,
which requires the Google "scope" parameter.
Original issue reported on code.google.com by bowman.j...@gmail.com on 21 Mar 2010 at 7:50
Original issue reported on code.google.com by
bowman.j...@gmail.com
on 21 Mar 2010 at 7:50