def _build_auth_headers(self):
"""
Build a dictionary of the authentication required for
accessing OAuth endpoints.
Args:
None
Returns:
value (dict) with the 'Authorization' key and value
"""
auth = base64.encodestring((self.client_id + ':' + self.client_secret).encode('latin-1')).decode('latin-1')
auth = auth.replace('\n', '').replace(' ', '')
auth = 'Basic {}'.format(auth)
headers = {
'Authorization': auth
}
return headers
评论列表
文章目录