NabuCasa / pycognito

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

Signing in fails if locale.LC_TIME is set to a non-English language #122

Closed cft1385 closed 2 years ago

cft1385 commented 2 years ago

In the process_challenge function, there is a call to strftime that depends on the current locale. If it is not English, AWS will respond with this error:

TIMESTAMP format should be EEE MMM d HH:mm:ss z yyyy in english

The problem can be reproduced like this:

locale.setlocale(locale.LC_TIME, "nb_NO.utf-8")
u = Cognito(...)
u.authenticate(...)