Ejemplo n.º 1
0
 def test_set_attributes(self):
     user = Cognito(self.cognito_user_pool_id, self.app_id)
     user._set_attributes({"ResponseMetadata": {
         "HTTPStatusCode": 200
     }}, {"somerandom": "attribute"})
     self.assertEqual(user.somerandom, "attribute")
 def get_queryset(self):
     return Cognito(
         settings.COGNITO_USER_POOL_ID, settings.COGNITO_APP_ID
     ).get_users(attr_map=settings.COGNITO_ATTR_MAPPING)
Ejemplo n.º 3
0
from pycognito import Cognito
import pprint
import env

pp = pprint.PrettyPrinter(indent=4)

u = Cognito(env.USER_POOL_ID,
            env.CLIENT_ID,
            client_secret=env.CLIENT_SECRET,
            access_key=env.ACCESS_ID,
            secret_key=env.ACCESS_KEY)

users = u.get_users(attr_map={
    "mail": "email",
    "given_name": "first_name",
    "family_name": "last_name"
})
for user in users:
    print('{}'.format(user.email))