fix(cognito): 🐛 include USERNAME in SRP PASSWORD_VERIFIER challenge (#1316)

InitiateAuth with USER_SRP_AUTH returned a PASSWORD_VERIFIER challenge
whose ChallengeParameters carried USER_ID_FOR_SRP but not USERNAME. Real
AWS Cognito returns both, and the .NET Amazon.Extensions.CognitoAuthentication
SRP client reads ChallengeParameters["USERNAME"], so it threw
KeyNotFoundException against floci.

Add USERNAME alongside USER_ID_FOR_SRP and assert it in the SRP flow test.

Closes #1305
This commit is contained in:
Lorenzo Galassi authored and GitHub committed 2026-06-13 02:30:27 -05:00
1 parent a032ec5ac0
commit a7b0826c96
2 files changed
+4

No files matched your search

@@ -348,6 +348,7 @@ final class CognitoAuthFlowHandler {
"SALT", user.getSrpSalt(),
"SRP_B", bPublicHex,
"SECRET_BLOCK", secretBlockBase64,
"USERNAME", user.getUsername(),
"USER_ID_FOR_SRP", user.getUsername()
));
return result;