AWS Toolkit VS2022 - Session token not found

0

Using AWS Toolkit for Visual Studio 2022. All working fine, then suddenly started getting "Unable to connect to AWS: Session token not found or invalid" when I try to start an sso session.

Profile has not changed AWS account has not changed

toolkit log has this: 2023-06-14 19:19:21,364 [99] ERROR Amazon.AWSToolkit.Credentials.Core.AwsConnectionManager - Failed to switch to credentials: Profile:sso Amazon.SSO.Model.UnauthorizedException: Session token not found or invalid ---> Amazon.Runtime.Internal.HttpErrorResponseException: The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at Amazon.Runtime.Internal.HttpRequest.GetResponse() in D:\JenkinsWorkspaces\trebuchet-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler_bcl\HttpWebRequestFactory.cs:line 169

1 Answer
0
Accepted Answer

You can follow these steps:

  1. Refresh AWS SSO credentials: If you're using AWS Single Sign-On (SSO) to manage your AWS access, try refreshing your SSO credentials. In the AWS Toolkit, navigate to the "AWS Explorer" window, right-click on your SSO profile, and select "Refresh AWS SSO Credentials." This will retrieve a new session token.

  2. Check AWS SSO configuration: Ensure that your AWS SSO configuration is properly set up, including the Identity Source, permissions, and role assignments. Check for any misconfigurations or changes that might affect your ability to start an SSO session.

  3. Review AWS SSO session duration: Verify the session duration of your AWS SSO configuration. If the session duration is too short, it may expire before you can establish a connection using the AWS Toolkit. Consider extending the session duration to allow enough time for the AWS Toolkit to complete its operations.

If the issue persists after following these steps, you may need to consult the AWS Toolkit documentation so you can click here.

profile picture
Amol_M
answered a year ago
profile picture
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions