cfclient error (CF-InvalidAuthToken|1000): Invalid Auth Token
jameshochadel opened this issue · 5 comments
I can make API calls with the client when I've recently run a command with the cf CLI, because the CLI has used the refresh token to get a new access token. However, if I let the access token expire, I get the error in the title.
Versions:
- CLI version:
cf version 8.2.0+fd8fbca64.2022-02-09
- go-cfclient version: https://github.com/cloudfoundry-community/go-cfclient/releases/tag/v3.0.0-alpha.5
- cf API version: 3.147.0
I looked at the open issues and noticed #345, but I don't think the issue is the same. The refresh token works as expected with the cf CLI, so I don't think it's invalid or expiring.
I checked the CloudController and it returns a 401 status code with this error. I wonder if something is catching the http status before the executor gets it and tries to reauth.
Are you using config.NewFromCFHomeDir()
? That doesn't read the refresh token, only the access token.
Awesome — thank you @sneal, and sorry I didn't get back to you. I appreciate you following up on it.