Skip to content

Instantly share code, notes, and snippets.

@jasimmonsv
Last active April 18, 2019 21:04
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 jasimmonsv/4d67d634370c9b7d9ec8d9b7728d6b32 to your computer and use it in GitHub Desktop.
Save jasimmonsv/4d67d634370c9b7d9ec8d9b7728d6b32 to your computer and use it in GitHub Desktop.
Obtaining Client Credentials token for OAUTH2
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