NabuCasa / pycognito

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

[Feature] Device SRP / Device Password Verification Support #133

Open jimmyherron opened 2 years ago

jimmyherron commented 2 years ago

Hi Guys

Would love to see device SRP support, I'm really struggling to figure out https://aws.amazon.com/premiumsupport/knowledge-center/cognito-user-pool-remembered-devices/ in python. No matter what combination of things I do, this fails.

I'd be happy to contribute where I got up to in exchange for some TLC.

Let me know

Taikono-Himazin commented 2 years ago

This is my guess, but referring to the boto3 reference, it seems necessary to do the following:

initiate_auth reference Execute initiate_auth () The AccessToken and NewDeviceMetadata of this response contain the DeviceKey, so save it.

update_device_status reference Execute update_device_status (AccessToken, DeviceKey, DeviceRememberedStatus ='remembered') You should now remember your device in Cognito.

I haven't actually tried it, but what about it? These are probably not implemented in pycognito, so I think it's better to run them using the client in pycognito (the client of boto3).