Created
June 17, 2014 20:00
-
-
Save rdegges/6cd8724e3a2394cd0860 to your computer and use it in GitHub Desktop.
Iterate Through Stormpath Accounts, Printing Custom Data
This file contains hidden or 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
from json import dumps | |
from os import environ | |
from stormpath.client import Client | |
APPLICATION_NAME = 'test' | |
client = Client( | |
id = environ.get('STORMPATH_API_KEY_ID'), | |
secret = environ.get('STORMPATH_API_KEY_SECRET'), | |
) | |
application = client.applications.search(APPLICATION_NAME)[0] | |
for account in application.accounts.query(status='ENABLED'): | |
print account.given_name, account.surname, account.email | |
print dumps(dict(account.custom_data), indent=2, sort_keys=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment