I am new to coding and have ran into a problem trying to encode a string.
>>> import hashlib
>>> a = hashlib.md5()
>>> a.update(\'
For Python3 the following worked.
secretKey = b"secret key that you get from Coginito -> User Pool -> General Settings -> App Clients-->Click on Show more details -> App client secret"
clientId = "Coginito -> User Pool -> General Settings -> App Clients-->App client id"
digest = hmac.new(secretKey,
msg=(user_name + clientId).encode('utf-8'),
digestmod=hashlib.sha256
).digest()
signature = base64.b64encode(digest).decode()
The username user_name in the above is same as the user that you want to register in the cognito.