I am trying to create a scratch orgs from visual studio, I authorise the dev hub successfully but when I try to create a scratch org it throw this error :
ERROR: Error authenticating with the refresh token due to: expired access/refresh token.
I tried with 3-4 dev hub orgs, all the dev hub org authorised successfully, but cant able to create scratch orgs. Please advise
%USERPROFILE%\.sfdxin windows. This will open folder which is host of .json files. All connected orgs .json files will be here.
Inside the file, has the hashes for current access token, refresh token, and all the other OAuth goodness that allows DX to access your org. So simply deleted that file using command:
That appears to have cleaned it all up, and I'm no longer bothered by the "invalid grant" message and the shadow org.
After this done try to create scratch org.