aws / aws/aws-sam-cli

Bug: SSO Authentication stopped working

Open
#4,303 6 comments 0 reactions 0 assignees View on GitHub
maintainer/need-followup type/question
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:
Since installing `sam` 1.60.0, we notice that the Session is expired even though the Credentials are not.

### Steps to reproduce:
* Login into SSO `aws configure sso --profile default`
* Add SSO Credentials to `$HOME/.aws/config`

### Observed result:
```
sam package --output-template-file packaged.yaml --s3-bucket
Error: Unable to upload artifact referenced by Location parameter of resource.
Unable to upload artifact referenced by CodeUri parameter of resource.
The SSO session associated with this profile has expired or is otherwise invalid. To refresh this SSO session run aws sso login with the corresponding profile.
make: *** [package] Error 1
```

`~/.aws/sso/cache/.json` contents:

```
{
"startUrl": "",
"region": "eu-west-1",
"accessToken": ",
"expiresAt": "2022-10-14T17:12:19Z",
"clientId": "",
"clientSecret": "",
"registrationExpiresAt": "2023-01-12T09:12:11Z"
}
```

By performing a simple command, like `aws s3 ls` everything is shown correctly.

This happens around 20/30 minutes after SSO CLI Login

### Expected result:
`sam package` to work

### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
1. OS: Mac OSX
2. `sam --version`: 1.60.0
3. AWS region: eu-west-1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.