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

Use correct CreateTokenCommand #5724

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Use correct CreateTokenCommand #5724

merged 1 commit into from
Jan 26, 2024

Conversation

michaelgmcd
Copy link
Contributor

@michaelgmcd michaelgmcd commented Jan 24, 2024

Description

My team was pretty consistently seeing "Token is expired. To refresh this SSO session run 'aws sso login' with the corresponding profile." errors when trying to use the AWS JS SDK. After doing some debugging, I was able to boil it down to the following error:

ReferenceError: _CreateTokenCommand is not defined
    at CreateTokenCommand.resolveMiddleware (......./node_modules/@aws-sdk/token-providers/dist-cjs/bundle/client-sso-oidc-node.js:914:94)
    at SSOOIDCClient.send (......./node_modules/@smithy/smithy-client/dist-cjs/index.js:110:29)
    at getNewSsoOidcToken (......./node_modules/@aws-sdk/token-providers/dist-cjs/index.js:57:24)
    at ......./node_modules/@aws-sdk/token-providers/dist-cjs/index.js:155:35
    at async resolveSSOCredentials (......./node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js:56:22)
    at async ......./node_modules/@smithy/property-provider/dist-cjs/index.js:79:27

This PR fixes this issue, and tokens are now created properly.

Testing

Tested locally in my AWS deployment


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@michaelgmcd michaelgmcd requested a review from a team as a code owner January 24, 2024 21:16
@kuhe kuhe merged commit be36543 into aws:main Jan 26, 2024
1 check passed
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 Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants