CognitoIdp fixes (#4518)

This commit is contained in:
mianowski 2022-03-10 15:38:43 +01:00 committed by GitHub
parent 07913cfef0
commit a4f58f0774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1525,7 +1525,7 @@ class CognitoIdpBackend(BaseBackend):
"ChallengeParameters": {
"SALT": uuid.uuid4().hex,
"SRP_B": uuid.uuid4().hex,
"USERNAME": user.id,
"USERNAME": user.username,
"USER_ID_FOR_SRP": user.id,
"SECRET_BLOCK": session,
},

View File

@ -2561,6 +2561,7 @@ def user_authentication_flow(conn):
result["AuthenticationResult"]["IdToken"].should_not.be.none
result["AuthenticationResult"]["AccessToken"].should_not.be.none
result["AuthenticationResult"]["TokenType"].should.equal("Bearer")
# authenticate user once again this time with mfa token
result = conn.initiate_auth(
@ -3317,6 +3318,7 @@ def test_initiate_auth_USER_SRP_AUTH():
)
result["ChallengeName"].should.equal("PASSWORD_VERIFIER")
result["ChallengeParameters"]["USERNAME"].should.equal(username)
@mock_cognitoidp
@ -3385,6 +3387,7 @@ def test_initiate_auth_USER_PASSWORD_AUTH():
result["AuthenticationResult"]["AccessToken"].should_not.be.none
result["AuthenticationResult"]["IdToken"].should_not.be.none
result["AuthenticationResult"]["RefreshToken"].should_not.be.none
result["AuthenticationResult"]["TokenType"].should.equal("Bearer")
@mock_cognitoidp