Access via API Key randomly gives access denied

We have a utility where we upgrade applications across several environments in Rancher and we have an issue where we will get Access Denied calling v1/projects right after we successfully call v1-catalog/catalogs using the same API key. The only solution we have found is to open a browser and log in or if the browser is open log off, close the browser open a new browser and log in. Is there anyone else having this same problem or that has found a solution?