feat(cognito): enforce app client ExplicitAuthFlows in InitiateAuth and AdminInitiateAuth (#3974)

ExplicitAuthFlows was stored but never checked, so a client that only allowed SRP still accepted USER_PASSWORD_AUTH. When a client lists flows, reject any flow it does not enable with InvalidParameterException. Legacy values (USER_PASSWORD_AUTH, ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY) are honored, and clients created without a list stay ungated.

The Java compatibility test signed in with ADMIN_USER_PASSWORD_AUTH on a client that never enabled it; add ALLOW_ADMIN_USER_PASSWORD_AUTH to that client.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-20 21:04:55 -05:00
1 parent e14221fe62
commit a12bf8c96c
4 files changed
+199 -11

No files matched your search

@@ -122,6 +122,7 @@ class CognitoFeaturesTest {
.clientName("compat-test-client")
.explicitAuthFlows(
ExplicitAuthFlowsType.ALLOW_USER_PASSWORD_AUTH,
ExplicitAuthFlowsType.ALLOW_ADMIN_USER_PASSWORD_AUTH,
ExplicitAuthFlowsType.ALLOW_REFRESH_TOKEN_AUTH));
clientId = resp.userPoolClient().clientId();
assertThat(clientId).isNotBlank();