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

Region is missing : CognitoIdentityProviderClient #5965

Closed
3 tasks done
howdyhyber opened this issue Apr 5, 2024 · 4 comments
Closed
3 tasks done

Region is missing : CognitoIdentityProviderClient #5965

howdyhyber opened this issue Apr 5, 2024 · 4 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@howdyhyber
Copy link

howdyhyber commented Apr 5, 2024

Checkboxes for prior research

Describe the bug

I specified the region already, it works in local but it doesn't work in production.

SDK version number

"@aws-sdk/client-cognito-identity": "^3.549.0", "@aws-sdk/client-cognito-identity-provider": "^3.549.0", "@aws-sdk/credential-provider-cognito-identity": "^3.549.0"

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v16.14.2

Reproduction Steps

const credentials = fromCognitoIdentityPool({
                clientConfig: { region: "ap-southeast-1" },
                identityPoolId: aws_cognito_identity_pool_id,
                logins: {
                    [`cognito-idp.ap-southeast-1.amazonaws.com/xxxx`]: jwtToken
                }
            });

            let client = new CognitoIdentityProviderClient(
                {
                    region: "ap-southeast-1",
                    credentials
                }
            )

            try {
                let data = await client.send(command);
                // process data.
                console.log("Data : ", data);
                resolve({ message: "okay" });
            } catch (error) {
                // error handling.
                console.log("Error : ", error);
                resolve({ message: "not okay" });
            }

Observed Behavior

Works when run locally, does not run in production

Expected Behavior

Based on the current code, it should work, the config is right

Possible Solution

No response

Additional Information/Context

No response

@howdyhyber howdyhyber added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 5, 2024
@kuhe
Copy link
Contributor

kuhe commented Apr 5, 2024

please provide the full stack trace of the error

@RanVaknin
Copy link
Contributor

RanVaknin commented Apr 5, 2024

Hi @howdyhyber ,

It's not clear what your production environment looks like.

Your code seems correct, and the fact that it works locally points to a potential problem with the environment itself.

Like @kuhe suggested, can you please share the full stack trace for the error and perhaps tell us more about the environment in which you are executing the SDK code?

Thanks,
Ran~

@RanVaknin RanVaknin self-assigned this Apr 5, 2024
@RanVaknin RanVaknin added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Apr 5, 2024
@howdyhyber
Copy link
Author

howdyhyber commented Apr 8, 2024

I figured out what the problem is, I did not use @aws-sdk/credential-provider-cognito-identity because it is said in npm in its usage info, "You probably shouldn't, at least directly. Please use [@aws-sdk/credential-providers (https://www.npmjs.com/package/@aws-sdk/credential-providers) instead." I used @aws-sdk/credential-providers and it is perfectly working now.

@kuhe kuhe closed this as completed Apr 8, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants