Closed JacobDel closed 1 week ago
Hello, @JacobDel and sorry to hear you're running into this. Have a few questions to see if we can pin down what the root cause of this is.
Amplify.configure()
call beyond the userPoolId
, identityPoolId
and userPoolClientId
?Thank you for the follow up @cwomack
- Can you confirm that the User Pool and Identity Pool being used are the proper combination? That error appears to be thrown from the Cognito/server side.
I can confirm that the User Pool and Identity Pool are the proper combination. This is somewhat proven by using the same User Pool and Identity Pool credentials with aws-amplify v5 and having it work as expected.
- Are you passing in any else into the
Amplify.configure()
call beyond theuserPoolId
,identityPoolId
anduserPoolClientId
?
No, as shared in the code snippet, only userPoolClientId, identityPoolId and userPoolId.
During the migration from v5 to v6 I also change the variable userPoolWebClientId to userPoolClientId, can you confirm that both variables should have the same value?
@JacobDel, thanks for confirming the above details. Can you run Amplify.getConfig()
just before where you're calling fetchAuthSession()
and let us know what happens for the output? Just want to make sure the configuration values are matching what would be expected. I don't see any code examples where you're calling fetchAuthSession()
as well, so any chance you could provide the frontend code where that's being done?
Additionally, could you try making a get-credentials-for-identity call using the AWS CLI to see if you can get the AWS credentials without getting the error?
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue.
Thank you!
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
Other
Environment information
Describe the bug
A user is logged in from before migration. The code and packages are altered to comply with the v6 aws-amplify migration. The application is build and I get the following warning:
Possible unhandled promise rejection (id: 0): InvalidIdentityPoolConfigurationException: Invalid identity pool configuration. Check assigned IAM roles for this pool.
I close the warning and an error comes up when trying to signin:error signing in [UserAlreadyAuthenticatedException: There is already a signed in user.]
When I try to retrieve the auth session with this code:then I get this console output:
There is no error or crash noted, the app continues to work fine.
Note that aws-amplify v5 works fine and is still in use perfectly fine
Expected behavior
from code line:
I expect:
or
or something similar
Reproduction steps
Code Snippet
App.tsx
cognito_amplify_file.json:
Log output
aws-exports.js
No response
Manual configuration
cognito_amplify_file.json:
Additional configuration
No response
Mobile Device
iPhone 15 Pro emulated
Mobile Operating System
iOS latest
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots