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

Not able to call fromCognitoIdentityPool on iOS (browser) #531

Closed
raRaRa opened this issue Oct 3, 2024 · 5 comments
Closed

Not able to call fromCognitoIdentityPool on iOS (browser) #531

raRaRa opened this issue Oct 3, 2024 · 5 comments
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 5 days unless further comments are made. third-party This issue is related to third-party libraries or applications.

Comments

@raRaRa
Copy link

raRaRa commented Oct 3, 2024

Describe the bug

I just noticed that Chrome on iOS devices fails when calling fromCognitoIdentityPool. But it works on my desktop machine just fine with Chrome and Safari.

Example code:

    this.cachedCredentials = await fromCognitoIdentityPool({
      // Required. The unique identifier for the identity pool from which an identity should be
      // retrieved or generated.
      identityPoolId: this.options.IdentityPoolId,
      clientConfig: { region: this.options.Region },
    })();

The error I get:

DEBUG endpoints Resolving endpoint from template: {
  "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
  "properties": {},
  "headers": {}
}

ERROR[object Object]

I believe the error is related to TypeError: JSON.stringify cannot serialize cyclic structures

Expected Behavior

I expect it to run through the last step where it errors out, which should resolve to:

endpoints Resolved endpoint: {
  "headers": {},
  "properties": {},
  "url": "https://cognito-identity.eu-west-1.amazonaws.com/"
}

Current Behavior

Currently it errors on

DEBUG endpoints Resolving endpoint from template: {
  "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
  "properties": {},
  "headers": {}
}

Reproduction Steps

Just run fromCognitoIdentityPool from Chrome in iOS

Possible Solution

No response

Additional Information/Context

@aws-sdk/credential-providers is on version 3.664.0

SDK version used

1.21.1

Environment details (OS name and version, etc.)

iPhone 13 Pro, Google Chrome

@raRaRa raRaRa added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 3, 2024
@bretambrose
Copy link
Contributor

I'm not following how this is an issue with the IoT SDK.

@raRaRa
Copy link
Author

raRaRa commented Oct 3, 2024

I'm not following how this is an issue with the IoT SDK.

I wasn't sure where to report this. The samples use fromCognitoIdentityPool but they no longer work on Chrome in iOS. Do you know of any alternative ways to use cognitio identity pool without using fromCognitoIdentityPool

Should I report this to @aws-sdk/credential-providers

@bretambrose
Copy link
Contributor

Should I report this to @aws-sdk/credential-providers

That seems like it would get the best results. I'm not sure of the support status of that major version though.

@jmklix jmklix added third-party This issue is related to third-party libraries or applications. closing-soon This issue will automatically close in 5 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 4, 2024
@raRaRa
Copy link
Author

raRaRa commented Oct 6, 2024

Seems like it's a bug within some library that aws-sdk uses. I've created a separated report in the aws-sdk repo.
I also solved this by manually fetching the AWS Cognito identity and credentials without using the fromCognitoIdentityPool method.

@raRaRa raRaRa closed this as completed Oct 6, 2024
Copy link

github-actions bot commented Oct 6, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 5 days unless further comments are made. third-party This issue is related to third-party libraries or applications.
Projects
None yet
Development

No branches or pull requests

3 participants