Closed ash-v closed 2 years ago
@ash-v Thank you for raising the issue. To help you further I would need a few more details:
Also I would like to reiterate the problem to make sure that I understand the problem correctly:
Hi @harsh62 ,
Thanks for looking into this. The problem has evolved from when I opened this issue...
Ideally it should work if you have enabled unauthenticated access in Cognito Identity Pool. For some reason your app finds that you are an authenticated user and tries to get credentials believing that you are authenticated. Are you using the same app to test authenticated and unauth user? I am wondering whether you are getting auth status from the previous configuration.
You can make a call to Amplify.Auth.fetchAuthSession and check the result to verify that you are an unauth user or not.
So, this is working now... after @royjit's comment I double checked enabling unauthenticated access in Cognito Identity Pool and sure enough it wasn't enabled. I knew I did it but maybe got confused with multiple environments... please excuse the inconvenience. Appreciate everyone's input!4
Describe the bug
My app has Swiftui frontend and AWS amplify managed backend.
Issue: The App works on one IPhone, i.e. my test device, but doesn't work on any other iphone. I'm this seeing error "Refresh Token Expired" in CloudTrail under "InitiateAuth" event when I try to access the app from any other iPhone. I tried to explicitly fetch the session as explained https://docs.amplify.aws/lib/auth/access_credentials/q/platform/ios/ but having this doesn't work either. When trying to run this updated code with simulator, following error occurs
My Setup
Steps To Reproduce
Expected behavior
Amplify Framework Version
7.6.5
Amplify Categories
API, Auth
Dependency manager
Cocoapods
Swift version
5.5.2
CLI version
7.6.5
Xcode version
13.2.1
Relevant log output
Is this a regression?
No
Regression additional context
No response
Device
iPhone 7,8,12, and simulator on all
iOS Version
iOS 15.*
Specific to simulators
No response
Additional context
No response