D
D
delletenebre2013-02-28 06:33:48
Python
delletenebre, 2013-02-28 06:33:48

Python. Authorization OAuth

There was such a problem. There is a site with Connect with Facebook/Google/Twitter/etc. Is it possible, with the help of python, to log in to the site and get access to the personal account (for parsing)?

I googled this question, but in the output there are mainly libraries where you need to know the secret / api key (i.e. for the owners of the web resource).

Some more information. The site has a link like www.site.com/googleConnect, which contains a redirect 302 to google for login, tried to send a post with a login and password to the redirect link (because I assumed that tokens were already generated there, etc.), but the result is 0.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nochkin, 2013-02-28
@nochkin

It works a little differently:
1. The script gets the url (where the 302 goes).
2. The script gives this url to the user, who authorizes himself with his login and password (which the script does not receive)
3. Then the script receives a token from the service, with which this script can access those account resources that the user allowed during authorization in # 2.
The benefit is that the user does not give up his password. And also the user can at any time de-authorize this token if he no longer wants the script to have this access.
If you need to log in with the login and password by the script itself, then this is no longer OAuth, but parsing the forms directly. This one is still gimoroy and tambourines. A special "joy" comes when the service starts to make small changes in the html code from time to time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question