Hey,
maybe a little off-topic but I hope you can help me or point me in the right direction. The page I created a plugin for has changed the site completely and with this the login procedure.
The sign-in url is something like https://app.example.com/users/sign_in. I signed in with Firefox and used it’s Inspect Element tool to get the POST data. The curl command I got looks like
curl 'https://app.example.com/api/v1/auth/sign_in' -H 'Content-Type: application/json' -d '{"email":"username","password":"pass"}'
Note that the url here defers from the regular login url. Also note that I stripped down the headers from the command.
The curl command returns success and what seems to be my whole account information.
Now I can do the same in python with urllib2 and get the same result as the curl command. (The url being the same as the url in the curl command.) How can I manage to get a login to the usual site, i.e. https://app.example.com/users/sign_in and then get the page I am redirected to as a result? I think I don’t understand this whole thing behind json.
req = urllib2.Request("https://app.example.com/users/sign_in", json_data, headers)
>>> response = urllib2.urlopen(req)
>>> the_page = response.read()
doesn’t seem to work..
Do you guys need more information?
Would be glad to get some input. Thanks!