aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.31k stars 242 forks source link

amplify_authenticator: Existing user showing UserNotFoundException in Windows & Android but logged in with Web #2684

Closed fuzkabir closed 1 year ago

fuzkabir commented 1 year ago

Description

Front End SignInForm(), *There's no customization. With android studio Log in Process is successful with the web. But both android emulator and Windows are showing the message: User does not exist

and the following message in the console:

flutter: ERROR | Authenticator | Error in AuthBloc: UserNotFoundException {
  "message": "User does not exist.",
  "underlyingException": "UserNotFoundException {\n  message=User does not exist.,\n}"
}

Built apk files working ( not UserNotFoundException) in devices just after installation. but once closed no response (just a white screen) in future runs.

dependencies:

├── amplify_api 1.0.0-next.5
│   ├── amplify_api_android 1.0.0-next.5
│   │   └── flutter...
│   ├── amplify_api_dart 0.1.0+2
│   │   ├── web_socket_channel 2.3.0
│   │   │   ├── async...
│   │   │   ├── crypto...
│   │   │   └── stream_channel...
│   │   ├── amplify_core...
│   │   ├── async...
│   │   ├── aws_common...
│   │   ├── collection...
│   │   ├── json_annotation...
│   │   ├── meta...
│   │   ├── plugin_platform_interface...
│   │   └── stream_transform...
│   ├── amplify_api_ios 1.0.0-next.5
│   │   ├── amplify_core...
│   │   └── flutter...
│   ├── connectivity_plus 3.0.2
│   │   ├── connectivity_plus_platform_interface 1.2.3
│   │   │   ├── flutter...
│   │   │   ├── meta...
│   │   │   └── plugin_platform_interface...
│   │   ├── nm 0.5.0
│   │   │   └── dbus 0.7.8
│   │   │       ├── args 2.3.2
│   │   │       ├── ffi...
│   │   │       ├── meta...
│   │   │       └── xml...
│   │   ├── flutter...
│   │   ├── flutter_web_plugins...
│   │   ├── js...
│   │   └── meta...
│   ├── amplify_core...
│   ├── amplify_flutter...
│   ├── flutter...
│   ├── meta...
│   └── plugin_platform_interface...
├── amplify_auth_cognito 1.0.0-next.5
│   ├── amplify_auth_cognito_android 1.0.0-next.5
│   │   └── flutter...
│   ├── amplify_auth_cognito_dart 0.6.0
│   │   ├── oauth2 2.0.1
│   │   │   ├── collection...
│   │   │   ├── crypto...
│   │   │   ├── http...
│   │   │   └── http_parser...
│   │   ├── smithy_aws 0.4.1+1
│   │   │   ├── crclib 3.0.0
│   │   │   │   ├── tuple 2.0.1
│   │   │   │   └── meta...
│   │   │   ├── aws_common...
│   │   │   ├── aws_signature_v4...
│   │   │   ├── built_collection...
│   │   │   ├── built_value...
│   │   │   ├── collection...
│   │   │   ├── convert...
│   │   │   ├── crypto...
│   │   │   ├── intl...
│   │   │   ├── json_annotation...
│   │   │   ├── meta...
│   │   │   ├── path...
│   │   │   ├── smithy...
│   │   │   └── xml...
│   │   ├── worker_bee 0.1.3+3
│   │   │   ├── async...
│   │   │   ├── aws_common...
│   │   │   ├── built_collection...
│   │   │   ├── built_value...
│   │   │   ├── collection...
│   │   │   ├── js...
│   │   │   ├── meta...
│   │   │   ├── path...
│   │   │   ├── stack_trace...
│   │   │   ├── stream_channel...
│   │   │   └── stream_transform...
│   │   ├── amplify_core...
│   │   ├── amplify_secure_storage_dart...
│   │   ├── async...
│   │   ├── aws_common...
│   │   ├── aws_signature_v4...
│   │   ├── built_collection...
│   │   ├── built_value...
│   │   ├── collection...
│   │   ├── convert...
│   │   ├── crypto...
│   │   ├── fixnum...
│   │   ├── http...
│   │   ├── intl...
│   │   ├── js...
│   │   ├── json_annotation...
│   │   ├── meta...
│   │   ├── path...
│   │   ├── smithy...
│   │   ├── stream_transform...
│   │   └── uuid...
│   ├── amplify_auth_cognito_ios 1.0.0-next.5
│   │   ├── amplify_core...
│   │   └── flutter...
│   ├── async 2.10.0
│   │   ├── collection...
│   │   └── meta...
│   ├── flutter_web_plugins 0.0.0
│   │   ├── characters...
│   │   ├── collection...
│   │   ├── flutter...
│   │   ├── js...
│   │   ├── material_color_utilities...
│   │   ├── meta...
│   │   └── vector_math...
│   ├── path 1.8.2
│   ├── amplify_core...
│   ├── amplify_flutter...
│   ├── amplify_secure_storage...
│   ├── flutter...
│   ├── meta...
│   └── plugin_platform_interface...
├── amplify_authenticator 1.0.0-next.4
│   ├── flutter_localizations 0.0.0
│   │   ├── characters...
│   │   ├── clock...
│   │   ├── collection...
│   │   ├── flutter...
│   │   ├── intl...
│   │   ├── js...
│   │   ├── material_color_utilities...
│   │   ├── meta...
│   │   ├── path...
│   │   └── vector_math...
│   ├── smithy 0.4.0+2
│   │   ├── http_parser 4.0.2
│   │   │   ├── collection...
│   │   │   ├── source_span...
│   │   │   ├── string_scanner...
│   │   │   └── typed_data...
│   │   ├── shelf 1.4.0
│   │   │   ├── async...
│   │   │   ├── collection...
│   │   │   ├── http_parser...
│   │   │   ├── path...
│   │   │   ├── stack_trace...
│   │   │   └── stream_channel...
│   │   ├── typed_data 1.3.1
│   │   │   └── collection...
│   │   ├── async...
│   │   ├── aws_common...
│   │   ├── built_collection...
│   │   ├── built_value...
│   │   ├── collection...
│   │   ├── convert...
│   │   ├── crypto...
│   │   ├── fixnum...
│   │   ├── intl...
│   │   ├── json_annotation...
│   │   ├── meta...
│   │   ├── path...
│   │   ├── retry...
│   │   └── xml...
│   ├── stream_transform 2.1.0
│   ├── amplify_auth_cognito...
│   ├── amplify_core...
│   ├── amplify_flutter...
│   ├── async...
│   ├── aws_common...
│   ├── collection...
│   ├── flutter...
│   ├── intl...
│   └── meta...
├── amplify_flutter 1.0.0-next.5
│   ├── amplify_core 1.0.0-next.5
│   │   ├── aws_signature_v4 0.3.1+3
│   │   │   ├── async...
│   │   │   ├── aws_common...
│   │   │   ├── collection...
│   │   │   ├── convert...
│   │   │   ├── crypto...
│   │   │   ├── json_annotation...
│   │   │   ├── meta...
│   │   │   └── path...
│   │   ├── json_annotation 4.8.0
│   │   │   └── meta...
│   │   ├── retry 3.1.0
│   │   ├── async...
│   │   ├── aws_common...
│   │   ├── collection...
│   │   ├── intl...
│   │   ├── logging...
│   │   ├── meta...
│   │   └── uuid...
│   ├── amplify_datastore_plugin_interface 1.0.0-next.5
│   │   ├── amplify_core...
│   │   ├── collection...
│   │   ├── flutter...
│   │   └── meta...
│   ├── amplify_flutter_android 1.0.0-next.5
│   │   └── flutter...
│   ├── amplify_flutter_ios 1.0.0-next.5
│   │   ├── amplify_core...
│   │   └── flutter...
│   ├── amplify_secure_storage 0.1.4+2
│   │   ├── amplify_secure_storage_dart 0.1.4+3
│   │   │   ├── ffi 2.0.1
│   │   │   ├── win32 3.1.3
│   │   │   │   └── ffi...
│   │   │   ├── async...
│   │   │   ├── aws_common...
│   │   │   ├── built_collection...
│   │   │   ├── built_value...
│   │   │   ├── file...
│   │   │   ├── js...
│   │   │   ├── meta...
│   │   │   ├── path...
│   │   │   └── worker_bee...
│   │   ├── async...
│   │   ├── file...
│   │   ├── flutter...
│   │   ├── meta...
│   │   ├── path...
│   │   └── path_provider...
│   ├── aws_common 0.4.1
│   │   ├── http2 2.0.1
│   │   ├── mime 1.0.4
│   │   ├── os_detect 2.0.1
│   │   ├── async...
│   │   ├── built_collection...
│   │   ├── built_value...
│   │   ├── collection...
│   │   ├── js...
│   │   ├── json_annotation...
│   │   ├── logging...
│   │   ├── meta...
│   │   ├── path...
│   │   ├── stream_transform...
│   │   └── uuid...
│   ├── collection...
│   ├── flutter...
│   ├── meta...
│   └── plugin_platform_interface...
├── amplify_storage_s3 1.0.0-next.5
│   ├── amplify_db_common 0.1.2+2
│   │   ├── amplify_db_common_dart 0.2.0+2
│   │   │   ├── sqlite3 1.9.1
│   │   │   │   ├── collection...
│   │   │   │   ├── ffi...
│   │   │   │   ├── js...
│   │   │   │   ├── meta...
│   │   │   │   └── path...
│   │   │   ├── amplify_core...
│   │   │   ├── async...
│   │   │   ├── aws_common...
│   │   │   ├── drift...
│   │   │   ├── meta...
│   │   │   └── path...
│   │   ├── drift 2.4.2
│   │   │   ├── async...
│   │   │   ├── collection...
│   │   │   ├── convert...
│   │   │   ├── js...
│   │   │   ├── meta...
│   │   │   ├── sqlite3...
│   │   │   └── stream_channel...
│   │   ├── flutter...
│   │   ├── path...
│   │   └── path_provider...
│   ├── amplify_storage_s3_dart 0.1.6
│   │   ├── amplify_core...
│   │   ├── amplify_db_common_dart...
│   │   ├── async...
│   │   ├── aws_common...
│   │   ├── aws_signature_v4...
│   │   ├── built_collection...
│   │   ├── built_value...
│   │   ├── drift...
│   │   ├── fixnum...
│   │   ├── meta...
│   │   ├── path...
│   │   ├── smithy...
│   │   └── smithy_aws...
│   ├── path_provider 2.0.12
│   │   ├── path_provider_android 2.0.22
│   │   │   ├── flutter...
│   │   │   └── path_provider_platform_interface...
│   │   ├── path_provider_foundation 2.1.1
│   │   │   ├── flutter...
│   │   │   └── path_provider_platform_interface...
│   │   ├── path_provider_linux 2.1.7
│   │   │   ├── xdg_directories 0.2.0+3
│   │   │   │   ├── process 4.2.4
│   │   │   │   │   ├── file...
│   │   │   │   │   ├── path...
│   │   │   │   │   └── platform...
│   │   │   │   ├── meta...
│   │   │   │   └── path...
│   │   │   ├── ffi...
│   │   │   ├── flutter...
│   │   │   ├── path...
│   │   │   └── path_provider_platform_interface...
│   │   ├── path_provider_platform_interface 2.0.5
│   │   │   ├── platform 3.1.0
│   │   │   ├── flutter...
│   │   │   └── plugin_platform_interface...
│   │   ├── path_provider_windows 2.1.3
│   │   │   ├── ffi...
│   │   │   ├── flutter...
│   │   │   ├── path...
│   │   │   ├── path_provider_platform_interface...
│   │   │   └── win32...
│   │   └── flutter...
│   ├── amplify_core...
│   ├── aws_common...
│   ├── flutter...
│   └── meta...
├── auto_size_text 3.0.0
│   └── flutter...
├── bloc 8.1.1
│   └── meta...
├── built_collection 5.1.1
├── built_value 8.4.0
│   ├── fixnum 1.0.1
│   ├── built_collection...
│   ├── collection...
│   └── meta...
├── cached_network_image 3.2.1
│   ├── cached_network_image_platform_interface 1.0.0
│   │   ├── flutter...
│   │   └── flutter_cache_manager...
│   ├── cached_network_image_web 1.0.1
│   │   ├── cached_network_image_platform_interface...
│   │   ├── flutter...
│   │   └── flutter_cache_manager...
│   ├── octo_image 1.0.2
│   │   ├── flutter_blurhash 0.7.0
│   │   │   └── flutter...
│   │   └── flutter...
│   ├── flutter...
│   └── flutter_cache_manager...
├── chewie 1.4.0
│   ├── cupertino_icons 1.0.5
│   ├── wakelock 0.6.2
│   │   ├── wakelock_macos 0.4.0
│   │   │   ├── flutter...
│   │   │   ├── flutter_web_plugins...
│   │   │   └── wakelock_platform_interface...
│   │   ├── wakelock_platform_interface 0.3.0
│   │   │   ├── flutter...
│   │   │   └── meta...
│   │   ├── wakelock_web 0.4.0
│   │   │   ├── flutter...
│   │   │   ├── flutter_web_plugins...
│   │   │   ├── js...
│   │   │   └── wakelock_platform_interface...
│   │   ├── wakelock_windows 0.2.1
│   │   │   ├── flutter...
│   │   │   ├── wakelock_platform_interface...
│   │   │   └── win32...
│   │   ├── flutter...
│   │   └── meta...
│   ├── flutter...
│   ├── provider...
│   └── video_player...
├── cloud_firestore 4.2.0
│   ├── firebase_core 2.4.1
│   │   ├── firebase_core_platform_interface...
│   │   ├── firebase_core_web...
│   │   ├── flutter...
│   │   └── meta...
│   ├── firebase_core_platform_interface 4.5.2
│   │   ├── collection...
│   │   ├── flutter...
│   │   ├── flutter_test...
│   │   ├── meta...
│   │   └── plugin_platform_interface...
│   ├── cloud_firestore_platform_interface...
│   ├── cloud_firestore_web...
│   ├── collection...
│   ├── flutter...
│   └── meta...
├── cloud_firestore_platform_interface 5.9.1
│   ├── _flutterfire_internals 1.0.12
│   │   ├── collection...
│   │   ├── firebase_core...
│   │   ├── firebase_core_platform_interface...
│   │   ├── flutter...
│   │   └── meta...
│   ├── collection...
│   ├── firebase_core...
│   ├── flutter...
│   ├── meta...
│   └── plugin_platform_interface...
├── cloud_firestore_web 3.1.1
│   ├── firebase_core_web 2.1.0
│   │   ├── firebase_core_platform_interface...
│   │   ├── flutter...
│   │   ├── flutter_web_plugins...
│   │   ├── js...
│   │   └── meta...
│   ├── _flutterfire_internals...
│   ├── cloud_firestore_platform_interface...
│   ├── collection...
│   ├── firebase_core...
│   ├── flutter...
│   ├── flutter_web_plugins...
│   └── js...
├── convex_bottom_bar 3.2.0
│   └── flutter...
├── dotted_border 2.0.0+3
│   ├── path_drawing 1.0.1
│   │   ├── path_parsing 1.0.1
│   │   │   ├── meta...
│   │   │   └── vector_math...
│   │   ├── flutter...
│   │   ├── meta...
│   │   └── vector_math...
│   └── flutter...
├── dropdown_button2 1.9.2
│   └── flutter...
├── dropdownfield 1.0.0
│   └── flutter...
├── equatable 2.0.5
│   ├── collection...
│   └── meta...
├── flutter 0.0.0
│   ├── characters 1.2.1
│   ├── collection 1.17.0
│   ├── js 0.6.5
│   │   └── meta...
│   ├── material_color_utilities 0.2.0
│   ├── meta 1.8.0
│   ├── sky_engine 0.0.99
│   └── vector_math 2.1.4
├── flutter_animate 1.0.0
│   └── flutter...
├── flutter_bloc 8.1.2
│   ├── bloc...
│   ├── flutter...
│   └── provider...
├── flutter_cache_manager 3.3.0
│   ├── clock 1.1.1
│   ├── file 6.1.4
│   │   ├── meta...
│   │   └── path...
│   ├── http 0.13.5
│   │   ├── async...
│   │   ├── http_parser...
│   │   ├── meta...
│   │   └── path...
│   ├── pedantic 1.11.1
│   ├── uuid 3.0.7
│   │   └── crypto...
│   ├── collection...
│   ├── flutter...
│   ├── path...
│   ├── path_provider...
│   ├── rxdart...
│   └── sqflite...
├── flutter_lints 2.0.1
│   └── lints 2.0.1
├── flutter_phoenix 1.1.0
│   └── flutter...
├── flutter_test 0.0.0
│   ├── boolean_selector 2.1.1
│   │   ├── source_span...
│   │   └── string_scanner...
│   ├── fake_async 1.3.1
│   │   ├── clock...
│   │   └── collection...
│   ├── matcher 0.12.13
│   │   ├── meta...
│   │   └── stack_trace...
│   ├── source_span 1.9.1
│   │   ├── collection...
│   │   ├── path...
│   │   └── term_glyph...
│   ├── stack_trace 1.11.0
│   │   └── path...
│   ├── stream_channel 2.1.1
│   │   └── async...
│   ├── string_scanner 1.2.0
│   │   └── source_span...
│   ├── term_glyph 1.2.1
│   ├── test_api 0.4.16
│   │   ├── async...
│   │   ├── boolean_selector...
│   │   ├── collection...
│   │   ├── matcher...
│   │   ├── meta...
│   │   ├── source_span...
│   │   ├── stack_trace...
│   │   ├── stream_channel...
│   │   ├── string_scanner...
│   │   └── term_glyph...
│   ├── async...
│   ├── characters...
│   ├── clock...
│   ├── collection...
│   ├── flutter...
│   ├── js...
│   ├── material_color_utilities...
│   ├── meta...
│   ├── path...
│   └── vector_math...
├── font_awesome_flutter 10.1.0
│   └── flutter...
├── from_css_color 2.0.0
│   └── flutter...
├── go_router 3.1.0
│   ├── logging 1.1.1
│   ├── collection...
│   ├── flutter...
│   ├── flutter_web_plugins...
│   └── meta...
├── google_fonts 3.0.1
│   ├── crypto 3.0.2
│   │   └── typed_data...
│   ├── flutter...
│   ├── http...
│   └── path_provider...
├── image_cropper 3.0.1
│   ├── image_cropper_for_web 1.0.3
│   │   ├── flutter...
│   │   ├── flutter_web_plugins...
│   │   ├── image_cropper_platform_interface...
│   │   └── js...
│   ├── image_cropper_platform_interface 3.0.3
│   │   ├── flutter...
│   │   ├── http...
│   │   └── plugin_platform_interface...
│   └── flutter...
├── image_picker 0.8.5+3
│   ├── image_picker_android 0.8.5+5
│   │   ├── flutter_plugin_android_lifecycle 2.0.7
│   │   │   └── flutter...
│   │   ├── flutter...
│   │   └── image_picker_platform_interface...
│   ├── image_picker_for_web 2.1.10
│   │   ├── flutter...
│   │   ├── flutter_web_plugins...
│   │   └── image_picker_platform_interface...
│   ├── image_picker_ios 0.8.6+7
│   │   ├── flutter...
│   │   └── image_picker_platform_interface...
│   ├── image_picker_platform_interface 2.6.2
│   │   ├── cross_file 0.3.3+4
│   │   │   ├── js...
│   │   │   └── meta...
│   │   ├── flutter...
│   │   ├── http...
│   │   └── plugin_platform_interface...
│   └── flutter...
├── intl 0.17.0
│   ├── clock...
│   └── path...
├── json_path 0.4.1
│   ├── petitparser 5.1.0
│   │   └── meta...
│   └── rfc_6901 0.1.1
├── mime_type 1.0.0
├── multi_select_flutter 4.1.3
│   ├── collection...
│   └── flutter...
├── multi_select_search 0.0.3
│   └── flutter...
├── page_transition 2.0.4
│   └── flutter...
├── percent_indicator 4.2.2
│   └── flutter...
├── pin_code_fields 7.4.0
│   └── flutter...
├── plugin_platform_interface 2.1.3
│   └── meta...
├── provider 6.0.4
│   ├── nested 1.0.0
│   │   └── flutter...
│   ├── collection...
│   └── flutter...
├── qr_flutter 4.0.0
│   ├── qr 2.1.0
│   │   └── meta...
│   └── flutter...
├── rxdart 0.27.4
├── shared_preferences 2.0.15
│   ├── shared_preferences_android 2.0.15
│   │   ├── flutter...
│   │   └── shared_preferences_platform_interface...
│   ├── shared_preferences_ios 2.1.1
│   │   ├── flutter...
│   │   └── shared_preferences_platform_interface...
│   ├── shared_preferences_linux 2.1.3
│   │   ├── file...
│   │   ├── flutter...
│   │   ├── path...
│   │   ├── path_provider_linux...
│   │   ├── path_provider_platform_interface...
│   │   └── shared_preferences_platform_interface...
│   ├── shared_preferences_macos 2.0.5
│   │   ├── flutter...
│   │   └── shared_preferences_platform_interface...
│   ├── shared_preferences_platform_interface 2.1.0
│   │   ├── flutter...
│   │   └── plugin_platform_interface...
│   ├── shared_preferences_web 2.0.4
│   │   ├── flutter...
│   │   ├── flutter_web_plugins...
│   │   └── shared_preferences_platform_interface...
│   ├── shared_preferences_windows 2.1.3
│   │   ├── file...
│   │   ├── flutter...
│   │   ├── path...
│   │   ├── path_provider_platform_interface...
│   │   ├── path_provider_windows...
│   │   └── shared_preferences_platform_interface...
│   └── flutter...
├── sign_in_with_apple 4.1.0
│   ├── flutter...
│   ├── meta...
│   ├── sign_in_with_apple_platform_interface...
│   └── sign_in_with_apple_web...
├── sign_in_with_apple_platform_interface 1.0.0
│   ├── flutter...
│   ├── meta...
│   └── plugin_platform_interface...
├── sign_in_with_apple_web 1.0.1
│   ├── flutter...
│   ├── flutter_web_plugins...
│   ├── js...
│   └── sign_in_with_apple_platform_interface...
├── sqflite 2.2.0+2
│   ├── sqflite_common 2.4.2+2
│   │   ├── synchronized 3.0.1
│   │   ├── meta...
│   │   └── path...
│   ├── flutter...
│   └── path...
├── syncfusion_flutter_barcodes 20.4.49
│   ├── flutter...
│   └── syncfusion_flutter_core...
├── syncfusion_flutter_pdf 20.4.49
│   ├── convert 3.1.1
│   │   └── typed_data...
│   ├── syncfusion_flutter_core 20.4.49
│   │   ├── flutter...
│   │   └── vector_math...
│   ├── xml 6.2.2
│   │   ├── collection...
│   │   ├── meta...
│   │   └── petitparser...
│   ├── crypto...
│   ├── flutter...
│   └── intl...
├── timeago 3.2.2
├── url_launcher 6.1.5
│   ├── url_launcher_android 6.0.23
│   │   ├── flutter...
│   │   └── url_launcher_platform_interface...
│   ├── url_launcher_ios 6.1.0
│   │   ├── flutter...
│   │   └── url_launcher_platform_interface...
│   ├── url_launcher_linux 3.0.2
│   │   ├── flutter...
│   │   └── url_launcher_platform_interface...
│   ├── url_launcher_macos 3.0.2
│   │   ├── flutter...
│   │   └── url_launcher_platform_interface...
│   ├── url_launcher_platform_interface 2.1.1
│   │   ├── flutter...
│   │   └── plugin_platform_interface...
│   ├── url_launcher_web 2.0.14
│   │   ├── flutter...
│   │   ├── flutter_web_plugins...
│   │   └── url_launcher_platform_interface...
│   ├── url_launcher_windows 3.0.3
│   │   ├── flutter...
│   │   └── url_launcher_platform_interface...
│   └── flutter...
└── video_player 2.5.1
    ├── html 0.15.1
    │   ├── csslib 0.17.2
    │   │   └── source_span...
    ├── video_player_web 2.0.13
    │   ├── flutter...
    │   ├── flutter_web_plugins...
    │   └── video_player_platform_interface...
    └── flutter...

Categories

Steps to Reproduce

No response

Screenshots

No response

Platforms

Flutter Version

3.7.0-1.5.pre

Amplify Flutter Version

1.0.0-next.5

Deployment Method

Amplify CLI

Schema

No response

fjnoyp commented 1 year ago

This is what I understand from your prompt:

You are using Authenticator with no custom setup.

You can sign in on web but on Android and Windows you get a 'User does not exist' exception.

Then when you close the android app and reopen you get a white screen. What future is running?

I am unable to reproduce your issue - I am able to sign up and sign in on Web and Android using the same user account. Did you use the code in the setup guide below to setup Authenticator in your application?

https://ui.docs.amplify.aws/flutter/connected-components/authenticator

fuzkabir commented 1 year ago

@fjnoyp Thanks. I'm Sorry, I meant reopening as 'future running'.

The fact is I've been working on this project for 3 months now. Even last week I was able to log in using android and windows. As my 1st target is the web (then android) I test with the Web only for the last few days. I guess there may be any issues with the packages I've installed recently.

Yes, I'm using exactly mention in the following documentation https://ui.docs.amplify.aws/flutter/connected-components/authenticator

Code snippet (omitting the formatting parts):

return Authenticator(
              authenticatorBuilder: (context, state) {
                switch (state.currentStep) {
                  case AuthenticatorStep.signIn:

                        SignInForm(),

The same is done for sign-up and other actions.

I'm not using datastore as till now it's not supported for web. packages in Pubspec.yaml:


 amplify_flutter: ^1.0.0-next.5
  amplify_auth_cognito: ^1.0.0-next.5
  amplify_authenticator: ^1.0.0-next.4

  amplify_storage_s3: ^1.0.0-next.5
  amplify_api: ^1.0.0-next.5

  # Bloc libraries
  equatable: ^2.0.3
  bloc: ^8.0.3
  flutter_bloc: ^8.0.1

  auto_size_text: 3.0.0
  built_collection: 5.1.1
  built_value: 8.4.0
  cached_network_image: 3.2.1
  cloud_firestore: 4.2.0
  cloud_firestore_platform_interface: 5.9.1
  cloud_firestore_web: 3.1.1
  dropdownfield: 1.0.0

  flutter_animate: 1.0.0
  flutter_cache_manager: 3.3.0
  font_awesome_flutter: 10.1.0
  from_css_color: 2.0.0
  go_router: 3.1.0
  google_fonts: 3.0.1

  image_picker:
  intl: 0.17.0
  json_path: 0.4.1

  mime_type: 1.0.0
  page_transition: 2.0.4
  percent_indicator: 4.2.2
  pin_code_fields: 7.4.0
  plugin_platform_interface: 2.1.3
  provider: 6.0.4
  rxdart: 0.27.4
  shared_preferences: 2.0.15
  sign_in_with_apple: 4.1.0
  sign_in_with_apple_platform_interface: 1.0.0
  sign_in_with_apple_web: 1.0.1
  sqflite: 2.2.0+2
  timeago: 3.2.2
  url_launcher: 6.1.5
  convex_bottom_bar: ^3.1.0+1
  syncfusion_flutter_pdf:
  syncfusion_flutter_barcodes:
  qr_flutter:
  chewie:
  video_player:
  image_cropper: ^3.0.1
  dotted_border: ^2.0.0+3
  dropdown_button2:
  flutter_phoenix: "^1.0.0"
  multi_select_flutter:
  multi_select_search:
fuzkabir commented 1 year ago

It's been 36 hours now but no response. @dnys1, last time your support was tremendous. Can you please have a look at this?

fuzkabir commented 1 year ago

Well, I have done some tests. As it is for production, I need to advance.

This time I'm using the exact example shown at https://pub.dev/packages/amplify_authenticator inside main.dart

Cut off all the dependencies to:

  amplify_auth_cognito: ^0.6.0
  amplify_authenticator: ^0.2.0
  amplify_flutter: ^0.6.0

The result is it's working in Android but not in Windows.

Then added all previous dependencies and the old main.dart. This time Android is working but for sure android is not.

I don't know how it got fixed. Whatever it is undoubtedly a bug. Because this UserNotFoundException is not the first time it has occurred and may return anytime. The development team needs to consider this fact.

@fjnoyp, you should check the Windows. I'm not closing until the Windows issue is solved. It is also a part of my deployment. Thanks.

dnys1 commented 1 year ago

Hi @fuzkabir sorry for the lack of response on this issue. I'll take a look today.

dnys1 commented 1 year ago

Hi @fuzkabir, I've tried to reproduce this in Windows using both debug and release builds but I've been unsuccessful so far. Would you be able to share the precise steps taken to reproduce this, including how you verify the user has been created successfully?

fuzkabir commented 1 year ago

Hi, @dnys1, Thanks for your response. Pardon, unsuccessful means unsuccessful to reproduce the issue or to log in? However, it's the project I've been working on and you may remember the last issue that also happened on this. Log in on windows was working, but one day I found it not. Currently, the Web and Android are working with no problem at all.

So, the steps:

  1. Installed the android studio dolphin 2021.3.1 patch 1
  2. Installed Amplify Cli and other steps ( I did it a long time ago)
  3. Used this resource to create the app https://salih.dev/creating-a-todo-application-with-flutter-aws-amplify-and-mason-in-15-minutes
  4. Then gradually Developed
  5. Last time I replaced and tested this in the project with the following

in pubspec.yaml

dependencies:
  amplify_auth_cognito: ^1.0.0-next.5+1
  amplify_authenticator: ^1.0.0-next.4+1
  amplify_flutter: ^1.0.0-next.5+1

main.dart

 import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';

import 'amplifyconfiguration.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    _configureAmplify();
  }

  Future<void> _configureAmplify() async {
    try {
      await Amplify.addPlugin(AmplifyAuthCognito());
      await Amplify.configure(amplifyconfig);
    } on Exception catch (e) {
      print('Could not configure Amplify: $e');
    }
  }

  @override
  Widget build(BuildContext context) {
    return Authenticator(
      child: MaterialApp(
        theme: ThemeData.light(),
        darkTheme: ThemeData.dark(),
        builder: Authenticator.builder(),
        home: const LoggedInScreen(),
      ),
    );
  }
}

class LoggedInScreen extends StatelessWidget {
  const LoggedInScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          children: const [
            Text('Logged In'),
            SignOutButton(),
          ],
        ),
      ),
    );
  }
}
  1. Works in Android and Web but not in Windows. I have Visual Studio Community 2022 Installed.

User Creation is done just by the process in the authorization. I Provide Sign Up credentials, Get the code by email and type it and Verified. All the users I'm trying with are listed as successfully verified in Cognito. They are working perfectly on Android and Web.

The remaining of Mason.yaml

bricks:

  amplify_starter: 0.1.0

amplifyconfiguration.dart

const amplifyconfig = ''' {
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "api": {
        "plugins": {
            "awsAPIPlugin": {
                "my_app": {
                    "endpointType": "GraphQL",
                    "endpoint": "https://api_key.appsync-api. my-region.amazonaws.com/graphql",
                    "region": " my-region",
                    "authorizationType": "AMAZON_COGNITO_USER_POOLS"
                }
            }
        }
    },
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "UserAgent": "aws-amplify-cli/0.1.0",
                "Version": "0.1.0",
                "IdentityManager": {
                    "Default": {}
                },
                "AppSync": {
                    "Default": {
                        "ApiUrl": "https://api_key.appsync-api. my-region.amazonaws.com/graphql",
                        "Region": " my-region",
                        "AuthMode": "AMAZON_COGNITO_USER_POOLS",
                        "ClientDatabasePrefix": "my_app_AMAZON_COGNITO_USER_POOLS"
                    },
                    "my_app_AWS_IAM": {
                        "ApiUrl": "https://api_key.appsync-api. my-region.amazonaws.com/graphql",
                        "Region": " my-region",
                        "AuthMode": "AWS_IAM",
                        "ClientDatabasePrefix": "my_app_AWS_IAM"
                    }
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": " my-region:pool_id",
                            "Region": " my-region"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": " my-region_zZE2flX89",
                        "AppClientId": "myAppClientId",
                        "Region": " my-region"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH",
                        "mfaConfiguration": "OFF",
                        "mfaTypes": [
                            "SMS"
                        ],
                        "passwordProtectionSettings": {
                            "passwordPolicyMinLength": 8,
                            "passwordPolicyCharacters": []
                        },
                        "signupAttributes": [
                            "EMAIL",
                            "PHONE_NUMBER"
                        ],
                        "socialProviders": [],
                        "usernameAttributes": [
                            "EMAIL",
                            "PHONE_NUMBER"
                        ],
                        "verificationMechanisms": [
                            "EMAIL"
                        ]
                    }
                },
                "S3TransferUtility": {
                    "Default": {
                        "Bucket": "my_app_bucket",
                        "Region": " my-region"
                    }
                },
                "DynamoDBObjectMapper": {
                    "Default": {
                        "Region": " my-region"
                    }
                }
            }
        }
    },
    "storage": {
        "plugins": {
            "awsS3StoragePlugin": {
                "bucket": "my_app_S3",
                "region": " my-region",
                "defaultAccessLevel": "guest"
            },
            "awsDynamoDbStoragePlugin": {
                "name": "spc",
                "region": " my-region",
                "arn": "arn:aws:dynamodb: my-region:table_id:table/spc",
                "partitionKeyName": "id",
                "partitionKeyType": "S"
            }
        }
    }
}''';

Compared to the Web and Android, the response in Windows is quick, It seems it has not even gotten connected to cognito.

Due to the time zone, I will be able to reply after 6 hours.

Thanks again.

fuzkabir commented 1 year ago

Today I updated flutter, no change. I missed some additional details yesterday. When I try to Sign up using windows It accepts the sign-up form and takes me to the verification part. But when I try to confirm the verification code for the first time, it shows the User does not exist for the first time, and when I press the confirm for 2nd time it shows, User cannot be confirmed, Current status is CONFIRMED. And the irony is the user has been shown as confirmed in the Cognito user pool. Undoubtedly, the unsuccessfully signed-up user got easily log-in into the Web or Android. And just to confirm, for log-in into windows, the user I'm trying with has not been created this way. This same experience I had in Android twice, and eventually got solved. This time is the first for windows.

dnys1 commented 1 year ago

Thank you for the extra information, @fuzkabir. I believe I was able to find some issues based off this. I will work to add fixes and tests to make sure they do not pop up again.

I appreciate your patience and will keep you posted here.

fuzkabir commented 1 year ago

Thank you, @dnys1.

It's real that I'm suffering from this issue right now but I'm sharing details so that Flutter Amplify becomes the best framework. This is my 3rd project with amplify and 1st with flutter. If this works perfectly, I'll have a complete track change to Flutter Amplify.

dnys1 commented 1 year ago

Thanks for your support. Our goal is the same as yours - to make Amplify Flutter the best framework possible!

I am prioritizing this work and will have an update for you shortly.

dnys1 commented 1 year ago

Hi @fuzkabir, sorry for the delayed response here. I did some investigation and was able to uncover a couple issues in the Authenticator which could be contributing to this issue. It took a while to get the PR merged and released, but I believe this should result in a better experience.

Can you update to the latest version of the libraries and let me know if you still experience this issue?

Thanks again for your patience and sorry for the lack of updates!

fuzkabir commented 1 year ago

Sorry @dnys1 for the delay, I really appreciate your effort. I'm right now in a critical state of my project and it'd take a few more days. Obviously, the authentication update is urgent for the project. Once the stage is done, I'll check it and get back to you. Thanks again.

dnys1 commented 1 year ago

Hi @fuzkabir, just wanted to follow up and see if you had noticed this problem since we last spoke. I believe it has been resolved. If not, I'd love to investigate more if you're able to provide an up-to-date set of reproduction steps.

Thanks for your patience during this.

fuzkabir commented 1 year ago

@dnys1 Really sorry as I have been implementing a Webrtc add-on to the project for the last 25 days, and everyday there's a new challenge. Another issue is that I have customized the authenticator to use it anyway.

Today I tried to upgrade to 1.0.0-next.5+2 but my old code is generating new problems like: final request = ModelQueries.get(AppUser.classType, queriedAppUser.id!); Error: The argument type 'String' can't be assigned to the parameter type 'ModelIdentifier'.

I know It's fixable and I will. but for now, fixing will drive my attention away from the problem I've working on.

So, Now I need a project where I can check with minimal requirements to respond to you. I've found your amplify_authenticator test project but it's showing the error like: Because amplify_authenticator_test depends on both amplify_lints from hosted and amplify_lints from the path, version solving failed. If can provide me with an URL of a project with minimal setup or requirement so that I can test it and I can reply to you ASAP. My project and the deadlines are not providing any extra time for the testing now. I hope you can understand and help on this.

Thanks a lot again.

dnys1 commented 1 year ago

Hi @fuzkabir. So we recently released v1 of Amplify Flutter as stable. We published a migration guide which may help with some of the breaking changes you noticed.

I've created a barebones repo with just the Authenticator code and added you as a collaborator. If you're able to reproduce it there, please feel free to push your changes. It would be greatly appreciated! https://github.com/dnys1/authenticator_repro

dnys1 commented 1 year ago

Closing for now. If you end up experiencing this on v1, please do reopen with any new logs/errors and reproduction steps. I'll be happy to help diagnose and to make sure it's resolved.