Created
March 11, 2020 22:10
-
-
Save youngsoul/892c6d5b911034df2cdb6e49a43058a1 to your computer and use it in GitHub Desktop.
snippet showing how to have a user login into a Cognito User Pool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resp=client.initiate_auth( | |
ClientId=os.getenv('CLIENT_ID'), | |
AuthFlow='USER_PASSWORD_AUTH', | |
AuthParameters={ | |
'USERNAME': email, | |
'SECRET_HASH': get_secret_hash(email, os.getenv('CLIENT_ID'), os.getenv('CLIENT_SECRET')), | |
'PASSWORD': password, | |
}) | |
return resp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment