in cognitoHandler.py [0:0]
def authenticateCognitoUser(self, username: str, password: str,
user_pool_id: str, app_client_id: str) -> None:
respUpdate = self.client.update_user_pool_client(
UserPoolId=user_pool_id,
ClientId=app_client_id,
ExplicitAuthFlows=['ADMIN_NO_SRP_AUTH','USER_PASSWORD_AUTH']
)
if respUpdate:
respInitiate = self.client.admin_initiate_auth(
UserPoolId=user_pool_id,
ClientId=app_client_id,
AuthFlow='ADMIN_NO_SRP_AUTH',
AuthParameters={
"USERNAME": username,
"PASSWORD": password
}
)
if respInitiate:
print("Log in success")
else:
exit()
return respInitiate['AuthenticationResult']['IdToken']