Skip to content

Conversation

@jboshoven-emporia
Copy link
Contributor

Added ability to add equivalent of AWS_ENDPOINT_URL to cognito user pool requests. This is done by adding CognitoUserPool > Default > Endpoint to the configuration. The endpoint must contain the pool ID like http://localhost:4556/us-east-1_pool_id.

Fixes: #5784

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Added ability to add equivalent of AWS_ENDPOINT_URL to cognito user pool requests. This is done by adding `CognitoUserPool > Default > Endpoint` to the configuration. The endpoint must contain the pool ID like `http://localhost:4556/us-east-1_pool_id`.
@jboshoven-emporia jboshoven-emporia requested a review from a team as a code owner December 16, 2025 23:50
@jboshoven-emporia
Copy link
Contributor Author

The tests are failing for

2025-12-18T17:41:02.1627477Z ##[group]❌ Authenticator sign-in-sms-mfa Sign in with unknown credentials (failed)
2025-12-18T17:41:02.1628812Z ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
2025-12-18T17:41:02.1629748Z The following TestFailure was thrown running a test:
2025-12-18T17:41:02.1630426Z Expected: should do the following in order:
2025-12-18T17:41:02.1631363Z           • emit an event that UnauthenticatedState:<UnauthenticatedState
2025-12-18T17:41:02.1632065Z [AuthenticatorStep.signIn]>
2025-12-18T17:41:02.1632863Z           • be done
2025-12-18T17:41:02.1633408Z   Actual: <Instance of '_ControllerStream<AuthState>'>
2025-12-18T17:41:02.1634344Z    Which: emitted • UnauthenticatedState [AuthenticatorStep.signIn]
2025-12-18T17:41:02.1635372Z                   • UnauthenticatedState [AuthenticatorStep.confirmSignUp]
2025-12-18T17:41:02.1636136Z             which didn't be done
2025-12-18T17:41:02.1636482Z 
2025-12-18T17:41:02.1636757Z When the exception was thrown, this was the stack:
2025-12-18T17:41:02.1637492Z #0      fail (package:matcher/src/expect/expect.dart:149:31)
2025-12-18T17:41:02.1638354Z #1      _expect.<anonymous closure> (package:matcher/src/expect/expect.dart:125:9)
2025-12-18T17:41:02.1639145Z <asynchronous suspension>
2025-12-18T17:41:02.1639673Z <asynchronous suspension>
2025-12-18T17:41:02.1640272Z (elided 6 frames from dart:async and package:stack_trace)
2025-12-18T17:41:02.1640754Z 
2025-12-18T17:41:02.1640952Z The test description was:
2025-12-18T17:41:02.1641466Z   Sign in with unknown credentials
2025-12-18T17:41:02.1642515Z ════════════════════════════════════════════════════════════════════════════════════════════════════
2025-12-18T17:41:02.1643588Z ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
2025-12-18T17:41:02.1644710Z The following TestFailure was thrown running a test (but after the test had completed):
2025-12-18T17:41:02.1645608Z Expected: exactly one matching candidate
2025-12-18T17:41:02.1646477Z   Actual: _DescendantWidgetFinder:<Found 0 widgets with text containing User does not exist
2025-12-18T17:41:02.1647814Z descending from widgets with key [<'authenticatorBanner'>]: []>
2025-12-18T17:41:02.1648500Z    Which: means none were found but one was expected
2025-12-18T17:41:02.1648895Z 
2025-12-18T17:41:02.1649147Z When the exception was thrown, this was the stack:
2025-12-18T17:41:02.1650060Z #0      fail (package:matcher/src/expect/expect.dart:149:31)
2025-12-18T17:41:02.1650737Z #1      _expect (package:matcher/src/expect/expect.dart:144:3)
2025-12-18T17:41:02.1651412Z #2      expect (package:matcher/src/expect/expect.dart:56:3)
2025-12-18T17:41:02.1652112Z #3      expect (package:flutter_test/src/widget_tester.dart:473:18)
2025-12-18T17:41:02.1653356Z #4      AuthenticatorPage.expectError (package:amplify_authenticator_test/src/pages/authenticator_page.dart:76:5)
2025-12-18T17:41:02.1654525Z #5      AuthenticatorPage.expectUserNotFound (package:amplify_authenticator_test/src/pages/authenticator_page.dart:107:32)
2025-12-18T17:41:02.1656007Z #6      main.<anonymous closure>.<anonymous closure> (file:///home/runner/work/amplify-flutter/amplify-flutter/packages/authenticator/amplify_authenticator/example/integration_test/sign_in_mfa_sms_test.dart:172:18)
2025-12-18T17:41:02.1657174Z <asynchronous suspension>
2025-12-18T17:41:02.1657689Z #7      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:192:15)
2025-12-18T17:41:02.1658217Z <asynchronous suspension>
2025-12-18T17:41:02.1658735Z #8      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1059:5)
2025-12-18T17:41:02.1659222Z <asynchronous suspension>
2025-12-18T17:41:02.1659501Z <asynchronous suspension>
2025-12-18T17:41:02.1659804Z (elided one frame from package:stack_trace)
2025-12-18T17:41:02.1660396Z ════════════════════════════════════════════════════════════════════════════════════════════════════

I'm struggling to reproduce the failure locally and the failing tests do not appear to be related to this PR.
Do you have any guidance on what to do next? Are these flaky tests that can be re-run? Do I need to modify my setup at all? I'm running on OSX.

@cadivus
Copy link
Member

cadivus commented Jan 6, 2026

Hi @jboshoven-emporia,

Thank you for your contribution to the AWS Amplify Flutter Library!
The tests are a bit flaky indeed. We are looking into it.

@jboshoven-emporia
Copy link
Contributor Author

This passed on the latest build, is it possible to get this PR checked in?

@cadivus cadivus merged commit 3de15e6 into aws-amplify:main Jan 9, 2026
283 of 369 checks passed
cadivus pushed a commit that referenced this pull request Jan 12, 2026
Added ability to add equivalent of AWS_ENDPOINT_URL to cognito user pool requests.

(cherry picked from commit 3de15e6)
cadivus pushed a commit that referenced this pull request Jan 12, 2026
Added ability to add equivalent of AWS_ENDPOINT_URL to cognito user pool requests.
cadivus pushed a commit that referenced this pull request Jan 13, 2026
Added ability to add equivalent of AWS_ENDPOINT_URL to cognito user pool requests.
@jboshoven-emporia
Copy link
Contributor Author

@cadivus Thanks for merging this!

@cadivus
Copy link
Member

cadivus commented Jan 15, 2026

@jboshoven-emporia You're welcome, thanks for the PR! It's already released to pubdev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Amplify Does Not Use Endpoint for Cognito Auth Calls

2 participants