Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiClientException: Failed to get credentials from Cognito Identity #2600

Closed
1 task done
uvinodh opened this issue Sep 29, 2023 · 5 comments
Closed
1 task done

ApiClientException: Failed to get credentials from Cognito Identity #2600

uvinodh opened this issue Sep 29, 2023 · 5 comments
Assignees
Labels
api auth Related to the Auth category/plugins not-reproducible Not able to reproduce the issue

Comments

@uvinodh
Copy link

uvinodh commented Sep 29, 2023

Before opening, please confirm:

Language and Async Model

Kotlin - Coroutines

Amplify Categories

Authentication

Gradle script dependencies

// Put output below this line
ext {
    amplifyVersion = '1.36.3'
}

   implementation 'com.amplifyframework:core-kotlin:0.2.0'
   
    implementation "com.amplifyframework:aws-analytics-pinpoint:$amplifyVersion"
    implementation "com.amplifyframework:aws-api:$amplifyVersion"
    implementation "com.amplifyframework:aws-auth-cognito:$amplifyVersion"
    implementation "com.amplifyframework:aws-datastore:$amplifyVersion"
    implementation "com.amplifyframework:aws-predictions:$amplifyVersion"
    implementation "com.amplifyframework:aws-storage-s3:$amplifyVersion"
     implementation 'com.amplifyframework:core:1.36.3'

Environment information

# Put output below this line


Please include any relevant guides or documentation you're referencing

No response

Describe the bug

We are getting the following error when we call an aws-sdk api just after login:
ApiClientException: Failed to get credentials from Cognito Identity

This is happening only on one device, Pixel 5.

Reproduction steps (if applicable)

No response

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@mattcreaser mattcreaser added auth Related to the Auth category/plugins pending-triage Issue is pending triage api labels Sep 29, 2023
@mattcreaser
Copy link
Member

Hi @uvinodh, could you please provide a more complete description of the issue? A snippet showing what call(s) you are trying to make and a full log output would be a good start.

I'm particularly interested in what you mean by "just after login" - does this mean after getting a response to the signIn API, or after receiving a Hub event, or something else? Also, is this a single device that you use for development testing?

@uvinodh
Copy link
Author

uvinodh commented Oct 3, 2023

@mattcreaser

Hey, Thanks for the response.

"just after login" => We use Amplify kotlin-coroutines signIn API for login.

Amplify.Auth.signIn(email, password)

After we get login response as success, we proceed to call one of our backend API using AWS SDK. This API responds with error "ApiClientException: Failed to get credentials from Cognito Identity"

This is happening on one of the customers device, which is Pixel 5.
Since, it's happening on the customer's phone, we are unable to provide the log output.

Thanks,

@gpanshu
Copy link
Contributor

gpanshu commented Oct 10, 2023

I have tested calling other Amplify APIs right after sign in and it seems to work. Can you please try the following:

  1. Update your Amplify to the latest versions of either the AWS SDK for Android (which is what you are currently using) or the V2 version (Amplify Android). I would recommend the V2 version.
  2. Add the logging plugin if you can debug this locally by adding Amplify.addPlugin(AndroidLoggingPlugin(LogLevel.VERBOSE)) as the very first line in your plugins list on your app.
    Once you have done the above please comment back with the results and we can dive deeper together.

@gpanshu gpanshu self-assigned this Oct 10, 2023
@gpanshu gpanshu added not-reproducible Not able to reproduce the issue bug Something isn't working and removed pending-triage Issue is pending triage bug Something isn't working labels Oct 10, 2023
@gpanshu
Copy link
Contributor

gpanshu commented Oct 30, 2023

Closing due to inactivity. If you are still facing an issue feel free to respond here to get this issue re-opened or create a new issue. Thank you.

@gpanshu gpanshu closed this as completed Oct 30, 2023
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api auth Related to the Auth category/plugins not-reproducible Not able to reproduce the issue
Projects
None yet
Development

No branches or pull requests

3 participants