Created
March 2, 2018 20:00
-
-
Save lstroud/b9c87a5be0db29fe7ccf072ff239ba02 to your computer and use it in GitHub Desktop.
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
#!/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