Skip to content

Instantly share code, notes, and snippets.

@davidsan
Created February 25, 2020 14:27
Show Gist options
  • Save davidsan/8e48cdc63e22ac6896bb40c7f6aec800 to your computer and use it in GitHub Desktop.
Save davidsan/8e48cdc63e22ac6896bb40c7f6aec800 to your computer and use it in GitHub Desktop.
import requests
s = requests.Session()
url = 'https://example.com'
username = 'alice'
password = 'hunter2'
r1 = s.get(url+'/login?action=get_auth_params')
lt = r1.json()
r2 = s.post(url + '/login?lt='+lt['lt']+'&username='+username+'&password='+password)
print(r2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment