Closed sanjeet-nosh closed 9 months ago
Hello @sanjeet-nosh, thanks for reaching out. A couple of quick questions -- how are you calling sign in and sign out? If you're using Amplify.signOut()
etc., handling the signOutResult
returned should tell you what error is occurring that prevents signing in afterwards (docs).
Also, I also see dependencies on Amplify as well as the AWS Android SDK, which are incompatible if for example you're trying to sign in using Amplify.signIn()
and then use the AWS SDK IoT with those credentials.
@sanjeet-nosh It is possible to use IoT with Amplify v2 by using a custom credentials provider to pass Amplify v2 credentials into IoT. However, you cannot mix other AWS Android SDK packages with Amplify v2, especially com.amazonaws:aws-android-sdk-cognito
. The SDK Cognito library and Amplify v2 Cognito library are incompatible in the same project.
Closing this issue due to inactivity. Please feel free to open a new issue if required, thanks!
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Before opening, please confirm:
Language and Async Model
Kotlin - Coroutines
Amplify Categories
Authentication
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
https://docs.amplify.aws/android/build-a-backend/auth/set-up-auth/
Describe the bug
After logging out from one user, when try to login again with new user it is throwing :
Fatal Exception: com.amplifyframework.auth.exceptions.InvalidStateException Auth state is an invalid state, cannot process the request. com.amplifyframework.auth.cognito.RealAWSCognitoAuthPlugin$fetchAuthSession$1.invoke (RealAWSCognitoAuthPlugin.kt:1163) com.amplifyframework.auth.cognito.RealAWSCognitoAuthPlugin$fetchAuthSession$1.invoke (RealAWSCognitoAuthPlugin.kt:1110) com.amplifyframework.statemachine.StateMachine$getCurrentState$1.invokeSuspend (StateMachine.kt:121)
Reproduction steps (if applicable)
No response
Code Snippet
Log output
amplifyconfiguration.json
{ "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "api": { xxxx } }, "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId":xx, "Region": "ap-south-1" } } }, "CognitoUserPool": { "Default": { "PoolId": "ap-south-1_jvyEjtkKf", "AppClientId": xx, "Region": "ap-south-1" } }, "Auth": { "Default": { "authenticationFlowType": "CUSTOM_AUTH" } } } } } }
GraphQL Schema
Additional information and screenshots
No response