Skip to content

Instantly share code, notes, and snippets.

@vershimajr
Last active August 30, 2019 11:17
Show Gist options
  • Save vershimajr/154ac9b4900f4579f20ddd1304d2984d to your computer and use it in GitHub Desktop.
Save vershimajr/154ac9b4900f4579f20ddd1304d2984d to your computer and use it in GitHub Desktop.
Temporal Auth using Python
import requests #first pip 'requests' library into your virtual environment
import json
auth_url = "https://api.temporal.cloud/v2/auth/login"
headers = {'Content-Type':'text/plain',}
credentials = {"username":"YOUR_USERNAME_HERE", "password":"YOUR_PASSWORD_HERE",}
payload = json.dumps(credentials)
r = requests.post(auth_url,data=payload,headers=headers)
token = r.json()['token']
expire = r.json()['expire']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment