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

GetCredentialsForIdentityCommand response case problem #5997

Closed
3 tasks done
gemmerton opened this issue Apr 12, 2024 · 3 comments
Closed
3 tasks done

GetCredentialsForIdentityCommand response case problem #5997

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

Comments

@gemmerton
Copy link

Checkboxes for prior research

Describe the bug

When using GetCredentialsForIdentityCommand the response returns AccessKeyId, SecretKey and SessionToken. However, other AWS services to which these credentials need to be passed are expecting the format accessKeyId, secretAccessKey and sessionToken.

So the response from the Cognito call needs to have the case changed in order to be useful for calls to other AWS services.

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Browser

Details of the browser/Node.js/ReactNative version

Chrome vers 123.0.6312.106

Reproduction Steps

Standard response from a GetCredentialsForIdentityCommand

Observed Behavior

As per description, response is incorrect case/format for use with other AWS services

Expected Behavior

response should contain accessKeyId, secretAccessKey and sessionToken

Possible Solution

No response

Additional Information/Context

No response

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

Hi @gemmerton ,

If you didn't know, all of the AWS SDKs are code generated from the API models of the various AWS services. The types the SDK generates are matching whatever the AWS service specifies in their API model (PascalCase AccessKeyId). The service team cannot change the casing of the response they return since it would be considered a breaking change.

The solution here is to reconstruct the credential object yourself. something like this:

const credentials = {
       accessKeyId: cognitoResponse.Credentials.AccessKeyId,
       secretAccessKey: cognitoResponse.Credentials.SecretAccessKey,
       sessionToken: cognitoResponse.Credentials.SessionToken
}

Thanks,
Ran~

@RanVaknin RanVaknin self-assigned this Apr 12, 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 12, 2024
Copy link

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Apr 23, 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 May 12, 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. closed-for-staleness 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

2 participants