Repository navigation
fix(cognito): resolve aliases in custom authentication - #2700
Open
dougludlow wants to merge 1 commit into
Open
dougludlow wants to merge 1 commit into
dougludlow wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
InitiateAuthwithCUSTOM_AUTHrejects an existing user whenUSERNAMEis their email and the pool usesUsernameAttributes=["email"]. These pools store users under generated usernames, but custom authentication looks up the supplied email directly and returnsNotAuthorizedExceptionbefore invokingDefineAuthChallenge.How
Resolve the supplied identifier with the existing pool-aware alias resolver after validating
SECRET_HASH. Use the stored username for user lookup and the subsequent challenge flow, matching the other authentication paths while preserving secret-hash validation against the supplied identifier.Test plan
Verification
The complete
cargo test --workspacerun was stopped during compilation because this environment lacks Go and Terraform, whichfakecloud-tfaccexplicitly requires. The AWS CLI is also absent, so the full acceptance suite remains unverified locally.Workspace Clippy on Rust 1.94.0 fails with
clippy::nonminimal_boolin unchanged upstream EC2 handlers:service/image.rs:294,service/snapshot.rs:198, andservice/volume.rs:456.The conformance library test run was stopped during dependency compilation when free disk dropped below 1 GiB in this 32 GiB workspace. Its tests remain unverified locally.
Summary by cubic
Fixes
InitiateAuthwithCUSTOM_AUTHrejecting existing users whenUSERNAMEis their email in pools configured withUsernameAttributes=["email"]. Custom auth now resolves the supplied identifier to the stored username afterSECRET_HASHvalidation, matching the other authentication flows.Bug Fixes
Written for commit 2b7cf1a. Summary will update on new commits.