Last active
April 18, 2019 21:04
-
-
Save jasimmonsv/4d67d634370c9b7d9ec8d9b7728d6b32 to your computer and use it in GitHub Desktop.
Obtaining Client Credentials token for OAUTH2
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 | |
url = 'https://domain.auth.us-east-1.amazoncognito.com/oauth2/token' | |
payload = { | |
'grant_type': 'client_credentials', | |
'client_id': '<client_id>', | |
'client_secret': '<client_secret>'} | |
res = requests.post(url, data=payload) | |
res.json()['access_token'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment