Skip to content

AWS Cognito - Amplify Configuration Manual - Flutter  #2291

Open
@balajiks-dev

Description

@balajiks-dev

Description

Hey Devs,
I have to write amplifyconfiguration.dart file manually without doing amplify configure in my Flutter Project. My Flutter Project using AWS Cognito for SignUp and SignIn.
I only have AppId, Pool Id and Region.
How can i able to achieve it.

Thanks

Categories

  • Analytics
    API (REST)
    API (GraphQL)
    Auth
    Authenticator
    DataStore
    Storage

Steps to Reproduce

No response

Screenshots

No response

Platforms

  • iOS
    Android
    Web
    macOS
    Windows
    Linux

Android Device/Emulator API Level

No response

Environment

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.4, on macOS 12.6 21G115 darwin-arm, locale
    en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.71.0)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

Dependencies

Dart SDK 2.18.2
Flutter SDK 3.3.4
aws_authentication 1.0.0+1

dependencies:
- amplify_auth_cognito 0.6.9 [amplify_auth_cognito_android amplify_auth_cognito_ios amplify_core aws_common collection flutter meta plugin_platform_interface]
- amplify_flutter 0.6.9 [amplify_core amplify_datastore_plugin_interface amplify_flutter_android amplify_flutter_ios aws_common collection flutter meta plugin_platform_interface]
- cupertino_icons 1.0.5
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]

transitive dependencies:
- amplify_auth_cognito_android 0.6.9 [flutter]
- amplify_auth_cognito_ios 0.6.9 [amplify_core flutter]
- amplify_core 0.6.9 [aws_common collection flutter intl json_annotation meta plugin_platform_interface uuid]
- amplify_datastore_plugin_interface 0.6.9 [amplify_core collection flutter meta]
- amplify_flutter_android 0.6.9 [flutter]
- amplify_flutter_ios 0.6.9 [amplify_core flutter]
- async 2.9.0 [collection meta]
- aws_common 0.1.1 [async collection http meta stream_transform uuid]
- characters 1.2.1
- clock 1.1.1
- collection 1.16.0
- crypto 3.0.2 [typed_data]
- http 0.13.5 [async http_parser meta path]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- json_annotation 4.7.0 [meta]
- material_color_utilities 0.1.5
- meta 1.8.0
- path 1.8.2
- plugin_platform_interface 2.1.3 [meta]
- sky_engine 0.0.99
- source_span 1.9.0 [collection path term_glyph]
- stream_transform 2.0.1
- string_scanner 1.1.1 [source_span]
- term_glyph 1.2.1
- typed_data 1.3.1 [collection]
- uuid 3.0.6 [crypto]
- vector_math 2.1.2

Device

N/A

OS

MacOS

Deployment Method

Amplify CLI

CLI Version

No response

Additional Context

No response

Amplify Config

var json = {
"CognitoUserPool": {
"Default": {"PoolId": "us-west-1", "AppClientId": "APP ID", "Region": "REGION"}
}
};

Activity

added
DocumentationImprovements or fixes to public documentation (docs.amplify.aws, pub.dev, readmes).
feature-requestA request for a new feature or an enhancement to an existing API or category.
on Oct 28, 2022
dnys1

dnys1 commented on Oct 28, 2022

@dnys1
Contributor

Hi @balajiks-dev thank you for the callout around the lack of documentation regarding the amplifyconfiguration file. The amplifyconfiguration file is parsed by the libraries into the AmplifyConfig type exported from package:amplify_flutter. If you'd prefer a typed interface, I would recommend creating a config this way then calling jsonEncode(config) to get the string expected by Amplify.configure.

There are some examples of building AmplifyConfig objects scattered throughout the library. We are also working on adding helper classes to the category configs, like AuthConfig.cognito to try and make it even easier. Although, this work is only happening in our dev-preview (v1.0.0-0) versions of the library.

Hope this helps!

balajiks-dev

balajiks-dev commented on Nov 21, 2022

@balajiks-dev
Author

Hi @dnys1
Thank you for your message. Hope it will be solved in the documentation for better understandable.

removed
feature-requestA request for a new feature or an enhancement to an existing API or category.
on Mar 21, 2023
self-assigned this
on Mar 21, 2023
added
feature-requestA request for a new feature or an enhancement to an existing API or category.
coreIssues related to the Amplify Core Plugin
and removed
DocumentationImprovements or fixes to public documentation (docs.amplify.aws, pub.dev, readmes).
on Jun 7, 2023
Jordan-Nelson

Jordan-Nelson commented on Jun 7, 2023

@Jordan-Nelson
Member

I recognize that documentation for this is still missing for this. However, I am marking this as a feature request as we are currently investigating ways that we can improve the experience around this (in addition to docs updates)

changed the title [-]AWS Cognito - AmilfyConfiguration Manual - Flutter [/-] [+]AWS Cognito - AmplifyConfiguration Manual - Flutter [/+] on Jul 26, 2023
changed the title [-]AWS Cognito - AmplifyConfiguration Manual - Flutter [/-] [+]AWS Cognito - Amplify Configuration Manual - Flutter [/+] on Jul 26, 2023
JesseRiemens

JesseRiemens commented on Sep 20, 2023

@JesseRiemens

I have another problem with this file, as I cannot get it generated with CI. Should I create a seperate issue for that?
I am using this script (Left out personal details)

FLUTTERCONFIG="{\
\"ResDir\":\"lib\",\
\"SourceDir\":\"lib\",\
\"DistributionDir\":\"build\",\
\"BuildCommand\":\"flutter build web\",\
\"StartCommand\":\"flutter run -d chrome\"\
}"
FRONTEND="{\
\"frontend\":\"flutter\",\
\"framework\":\"flutter\",\
\"config\":$FLUTTERCONFIG\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"

amplify pull \
--frontend $FRONTEND \
--amplify $AMPLIFY \
--providers $PROVIDERS \
--yes

But this does not generate the file for me, even though it is generated when I use the interactive version of the CLI. What am I doing wrong?

Jordan-Nelson

Jordan-Nelson commented on Jan 12, 2024

@Jordan-Nelson
Member

FYI - Documentation on existing resources can now be found on the "Existing Resources" tab here: https://docs.amplify.aws/flutter/build-a-backend/auth/set-up-auth/#set-up-backend-resources

balajiks-dev

balajiks-dev commented on Mar 5, 2024

@balajiks-dev
Author

@Jordan-Nelson I think it will be useful now. Thanks for your support!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreIssues related to the Amplify Core Pluginfeature-requestA request for a new feature or an enhancement to an existing API or category.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Jordan-Nelson@balajiks-dev@dnys1@JesseRiemens

        Issue actions

          AWS Cognito - Amplify Configuration Manual - Flutter · Issue #2291 · aws-amplify/amplify-flutter