# Automatically login to AWS SSO

**URL:** https://forum.serverless.com/t/automatically-login-to-aws-sso/21855
**Category:** Serverless Framework
**Created:** [July 24, 2026, 1:58pm UTC](https://forum.serverless.com/t/automatically-login-to-aws-sso/21855 "2026-07-24T13:58:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TomC](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tomc/32/4002_2.png) [@TomC](https://forum.serverless.com/u/TomC)
#### Post date: [July 24, 2026, 1:58pm UTC](https://forum.serverless.com/t/automatically-login-to-aws-sso/21855/1 "2026-07-24T13:58:43Z")

</div>

When I run a command like `sls info --stage dev --aws-profile sso` sls responds with

```  
AWS credentials missing or invalid. Original error from AWS: The SSO session associated with this profile has expi  
red. To refresh this SSO session run aws sso login with the corresponding profile.  
```

sls v3 with the better-credentials plugin would prompt at this point, opening a browser.

At the moment I have to jump out of my sls flow, manually run the aws CLI, and then return.

Could Sls v4 just do that like it used to ?

---

<div class="post-metadata">

### Author: ![poslas](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/poslas/32/8546_2.png) [@poslas](https://forum.serverless.com/u/poslas)
#### Post date: [September 8, 2026, 4:01am UTC](https://forum.serverless.com/t/automatically-login-to-aws-sso/21855/2 "2026-09-08T04:01:25Z")

</div>

I’d love to see this added back. Having SLS automatically detect an expired SSO session and trigger `aws sso login` would make the workflow much smoother, especially for users running commands like `sls info --stage dev --aws-profile sso`. It would save the extra manual step and keep the SLS flow uninterrupted.
