Failed to decipher auth data. reason: Unsupported state or unable to authenticate data.
Ever ran into this problem when using SFDX? I faced this issue and did some research and decided to provide my steps to fix this issue.
Problem Use-Case:
You might have your devHub and other sandbox when you try the below command.
sfdx force:org:list
If you find any orgs that have the below red color text
Failed to decipher auth data. reason: Unsupported state or unable to authenticate data.
the above error message indicates that one or more of your sandbox orgs are not authorized either using auth:web:login (or) auth:jwt:grant
Solution:
If you decide to start from scratch, then do the below first.
sfdx force:auth:list
then, do
sfdx force:auth:logout --all
the above command will “log” you out of all DevHub and sandbox orgs that you had connected earlier.
In order to make sure the configs are set correctly, do the below:
sfdx force:config:list
After executing the above command, if you find no config or if your defaultusername and defaultdevhubusername is wrong then execute the below command
sfdx force:config:set defaultusername={devhub username email} defaultdevhubusername={devhub username email}
The above commands should help you with all preliminary configs and you should be fine to run all below commands without a glitch!
sfdx force:org:open
sfdx force:org:create