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 246 forks source link

Anonymous Auth doesn't work with npx ampx pipeline-deploy #5434

Open verygoodstefan opened 1 month ago

verygoodstefan commented 1 month ago

Description

I have an Amplify project that uses amplify_auth_cognito_dart and fetches guest authentication data via fetchAuthSession. When I deploy the AWS resources for this project using npx ampx sandbox, I am able to consistently fetch the same identityPool ID on multiple calls to fetchAuthSession. When I deploy the project using npx ampx pipeline-deploy, however, calls to fetchAuthSession return brand new identity pool IDs every time.

Is there a reason that multiple calls to fetchAuthSession fetch a consistent identityPool ID in sandbox, but not in pipeline deploy?

Repo is here. It's a private repo, so if you want to look into the code, let me know and I will invite you.

Categories

Steps to Reproduce

  1. Setup auth via AmplifyAuthCognitoDart.
  2. Deploy resources via npx ampx pipeline-deploy
  3. Call fetchAuthSession multiple times, and inspect the identityId result.

Screenshots

No response

Platforms

Flutter Version

3.22.1

Amplify Flutter Version

0.11.3 (Amplify Auth Cognito Dart)

Deployment Method

Custom Pipeline

Schema

No response

tyllark commented 1 month ago

Hi @verygoodstefan, thank you for submitting this issue. We will take a look at this issue and get back to you when we have any updates or questions.

Equartey commented 3 weeks ago

Hi @verygoodstefan. To clarify, are you saying fetchAuthSession is returning a different identity pool ID than in sandbox, or is the ID truly different each time the function is called?

verygoodstefan commented 2 weeks ago

@Equartey both: the ID is different in production than sandbox (which is expected), but also, every time the fetchAuthSession is called, even if it has only been a second between calls, the ID is new.

khatruong2009 commented 2 weeks ago

Hi @verygoodstefan, I followed the reproduction steps but was unable to reproduce this issue. I deployed resources via npx ampx pipeline-deploy and called fetchAuthSession with guest credentials but got the same identity pool ID each time. Can you give us more details on your app configuration that would help us reproduce this?

verygoodstefan commented 2 weeks ago

@khatruong2009 the repo is here, if you want to see the configuration I have set up.

Equartey commented 1 week ago

Hey @verygoodstefan, just noticed you reported the platform as Linux, have you seen this issue on other platforms?

verygoodstefan commented 1 week ago

@Equartey I have not--my Amplify app is running on an AWS App Runner instance that uses a Linux server, so that's why I selected Linux.