capless / warrant

Python library for using AWS Cognito. With support for SRP.
Apache License 2.0
468 stars 192 forks source link

add custom attribute method #66

Closed sjoshi10 closed 6 years ago

sjoshi10 commented 6 years ago

I was trying to register using custom attributes but I wasn't able to. I modified the Cognito class by creating two methods that allows you to add base and custom attributes. add_custom_attributes method will take attributes and modify key so that you will be able to add custom attributes. With these methods, you don't have to pass attributes into Register method.

You can register by using these methods:


u.add_base_attributes(email='test@gmail.com')
u.add_custom_attributes(state='virginia', city='Centreville')
u.register('username', 'password')