Skip to content

Instantly share code, notes, and snippets.

@lstroud
Created March 2, 2018 20:00
Show Gist options
  • Save lstroud/b9c87a5be0db29fe7ccf072ff239ba02 to your computer and use it in GitHub Desktop.
Save lstroud/b9c87a5be0db29fe7ccf072ff239ba02 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
#
# List Active Okta Users
#
import requests
import json
token = 'WHATEVER_YOUR_TOKEN_IS'
limit = '200'
base_url = 'https://mycompany.okta.com/api/v1/'
url = base_url + '/users?limit=' + limit
headers = {'Authorization' : 'SSWS ' + token,
'Accept' : 'application/json',
'Content-Type' : 'application/json' }
r = requests.get(url, headers=headers)
json_obj = r.json()
for json_row in json_obj:
print(json_row['profile']['email'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment