The twitter API endpoint (twitter.com/oauth2/token
) requires API-Key and Secret in Basic Authorization header.
headers = {
'Authorization': 'Basic '+ str(base64.b64encode('API-KEY:API-SECRET'.encode('utf-8')).decode('utf-8')),
}
What I would like to do:
headers = {
'Authorization': 'Basic '+ str(base64.b64encode('MY-EMAIL:MY-PASSWORD'.encode('utf-8')).decode('utf-8')),
}
Is it possible?
No, this is not possible. Email and password are not suitably secure to be used in Twitter application authentication with the API (and should never be typed into third party apps or services).