Skip to content

Instantly share code, notes, and snippets.

@WillianFuks
Last active June 29, 2021 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillianFuks/0adeff4227c50ad52f9d503531bc81ea to your computer and use it in GitHub Desktop.
Save WillianFuks/0adeff4227c50ad52f9d503531bc81ea to your computer and use it in GitHub Desktop.
import requests
sess = requests.Session()
sess.verify = False # For testing locally
sess.post('https://localhost:8002/login/',
data={'username': 'alice', 'password': 'pass'})
sess.headers.update({'X-CSRFToken': sess.cookies['csrftoken']})
r = sess.post('https://localhost:8002/api/token/refresh/validate_refresh/',
headers={'REFERER': 'https://localhost:8002'},
data={'jwt_type': 'refresh'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment