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

fix(auth): SSO failed to get token due to missing 'refreshToken' #6234

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

nkomonen-amazon
Copy link
Contributor

@nkomonen-amazon nkomonen-amazon commented Dec 13, 2024

Problem:

Error users were seeing was:

Error: SSO cache data unexpectedly missing props: ["refreshToken"]

This was due to a change from a previous PR that assumed the refreshToken was always present in SSO cache.

Solution:

It looks like the refreshToken does not exist for all cases, so some research needs to be done.

But for now this reverts the validation that the refreshToken exists. Though it keeps the validation that the accessToken exists since that is always guaranteed.

A temporary workaround should be to sign out/in and things should start working. If not please downgrade 3.38.0 until we release this fix next week.

Fixes #6230


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

Problem:

Error users were seeing was:

```
Error: SSO cache data unexpectedly missing props: ["refreshToken"]
```

This was due to a check in a previos PR that assumed the refreshToken
was always present in SSO cache.

Solution:

It looks like the refreshToken does not exist for all cases, so some research needs
to be done.

But for now this reverts the check that the refreshToken exists, but it keeps the validation
that the accessToken exists since that is always guaranteed.

Signed-off-by: nkomonen-amazon <nkomonen@amazon.com>
Signed-off-by: nkomonen-amazon <nkomonen@amazon.com>
Copy link
Contributor

@jpinkney-aws jpinkney-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my understanding, is this a patch to fix the users issue but we still want to investigate why the refreshToken might not be stored in the cache?

@nkomonen-amazon
Copy link
Contributor Author

@jpinkney-aws correct

It looks like there maybe be cases where the identity service will not provide a refreshToken. Eg if the session length is short enough it might not provide one.

So this doesn't seem like a bug, but a behavior we'd want to document

@nkomonen-amazon nkomonen-amazon merged commit 96ce5ae into aws:master Dec 13, 2024
26 of 37 checks passed
@nkomonen-amazon nkomonen-amazon deleted the fixCache branch December 13, 2024 17:30
karanA-aws pushed a commit to karanA-aws/aws-toolkit-vscode that referenced this pull request Jan 17, 2025
…#6234)

## Problem:

Error users were seeing was:

```
Error: SSO cache data unexpectedly missing props: ["refreshToken"]
```

This was due to a change from a previous PR that assumed the
refreshToken was always present in SSO cache.

## Solution:

It looks like the refreshToken does not exist for all cases, so some
research needs to be done.

But for now this reverts the validation that the refreshToken exists.
Though it keeps the validation that the accessToken exists since that is
always guaranteed.

**A temporary workaround should be to sign out/in and things should
start working. If not please downgrade 3.38.0 until we release this fix
next week.**

Fixes aws#6230 

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Signed-off-by: nkomonen-amazon <nkomonen@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to connect with profile credentials
3 participants