Logging in to Python via twitter

The website uses 'login via twitter'. Like this site, use facebook. How can I log in and get cookies to log in to the site (using python) if I know the twitter username and password?

+4
source share
2 answers

In general, Twitter does not support authentication "username" and "password". Now Twitter uses OAuth2 for authentication. The python-twitter libraries are available for this. e.g.: https://github.com/simplegeo/python-oauth2

This may be useful for you: http://abhi74k.wordpress.com/2010/12/21/tweeting-from-python/

+5
source

You do not do this; You are using OAuth for authentication. Providing third-party sites with username and password authentication is a terrible security flaw and Twitter will no longer allow it.

See Twitter OAuth Doc for Authentication.

EDIT: Twitter still supports the 'xAuth' option , which allows authentication with a username and password. You need to get special permission from Twitter to use it.

+2
source

Source: https://habr.com/ru/post/1336584/


All Articles