TLDR if experiencing this token refresh error, create a user environment variable SF_TEMP_SHOW_SECRETS to true.
There appears to have been an update in the sf cli package that changes how IC2 needs to interact with it for OAuth connections.
I started getting this error when IC2 was trying to refresh access token to any of my environments.
org.apache.cxf.binding.soap.SoapFault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
I was able to interact with the sf commands in a prompt.
I tried all sorts of things, recreating all connections, even reinstalling sf. I deleted all IC2 files in the intellij appData/Roaming IC2 and options directories. None of that worked.
I noticed this looked odd in the illuminatedCloudSfdxCache.xml file:
<option name="accessToken" value="[REDACTED] Use 'sf org auth show-access-token' to view" />
which I am also seeing now when doing an 'sf org list'
and under the warnings section...
<option name="warnings">
<list>
<option value="Secrets are now hidden from 'sf org list' command output. Use the 'sf org auth' commands instead. As a temporary workaround, you can set SF_TEMP_SHOW_SECRETS=true to render these secrets. This workaround will be removed in an upcoming release." />
</list>
</option>
So I created a user variable SF_TEMP_SHOW_SECRETS set to true and everything started working again. Connections could refresh and we're back in business. There is now a different warning:
<option name="warnings">
<list>
<option value="The SF_TEMP_SHOW_SECRETS env var is set. This is a temporary env var to continue to show secrets in the 'sf org list' command output. This workaround will be removed in an upcoming CLI release. Switch to use the 'sf org auth' commands to avoid future disruption." />
</list>
</option>