Last active
August 30, 2019 11:17
-
-
Save vershimajr/154ac9b4900f4579f20ddd1304d2984d to your computer and use it in GitHub Desktop.
Temporal Auth using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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