0

When I'm trying to activate a service account using the gcloud CLI command.

gcloud auth activate-service-account --key-file key.json

I am getting the below error since yesterday. I was able to create a service account with the same command 2 months ago and the service account was created at that time.

ERROR: (gcloud.auth.activate-service-account) There was a problem refreshing your current auth tokens: ('invalid_grant: Invalid JWT Signature.', {'error': 'invalid_grant', 'error_description': 'Invalid JWT Signature.'})

What is the issue here?

double-beep
  • 5,031
  • 17
  • 33
  • 41
Ramu
  • 36
  • 5

1 Answers1

-2

I've come across this answer which might be helpful on your case. 2 common causes were:

  1. Your server’s clock is not in sync with NTP.

    Solution: Check the server time. If it's incorrect, fix it.
    
  2. The refresh token limit has been exceeded.

    Solution: Nothing you can do - they can't have more refresh tokens in use.
    

    Applications can request multiple refresh tokens. For example, this is useful in situations where a user wants to install an application on multiple machines. In this case, two refresh tokens are required, one for each installation. When the number of refresh tokens exceeds the limit, older tokens become invalid. If the application attempts to use an invalidated refresh token, an invalid_grant error response is returned.

    The limit for each unique pair of OAuth 2.0 client and is 50 refresh tokens (note that this limit is subject to change). If the application continues to request refresh tokens for the same Client/Account pair, once the 26th token is issued, the 1st refresh token that was previously issued will become invalid. The 27th requested refresh token would invalidate the 2nd previously issued token and so on.

Just to add, please verify the validity of the service account key and try to setup the environment variable again.

Soleign H.
  • 67
  • 6