[Fixed] Error loading SSO Token: The SSO access token has either expired or is otherwise invalid – Centos7

by
Ali Hasan
aws-cli centos7 php-8.2

Quick Fix: To resolve the error "SSO access token has expired or is otherwise invalid", update the token or grant the root folder 777 permission. Use --debug flag to identify the exact cause of the error in AWS commands.

The Problem:

A user is encountering an error message ‘Error loading SSO Token: The SSO access token has either expired or is otherwise invalid’ when trying to access a browser after running a PHP script to check AWS CLI accessibility inside a Centos 7 Docker container. The issue seems to be specific to the browser environment, as the same PHP script functions correctly when executed from within the container. The user seeks a solution to ensure consistent behavior regardless of the environment.

The Solutions:

Solution 1: Granting Permission

The issue you were experiencing with the error message “Error loading SSO Token: The SSO access token has either expired or is otherwise invalid” was due to a permission issue. To resolve this problem, you granted 777 permission to the root folder. This allowed the script to access the necessary files and directories and resolve the error message.

Q&A

How does the issue get fixed?

After granting 777 permission to the root folder, the error is resolved.

How to debug the code?

Use –debug flag at the end of the AWS commands.