Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

"Error getting access token for service account: Connection reset, iss: <>@<>.iam.gserviceaccount.co

Hi,

We are trying to connect Big Query using Spring boot project, connection is getting established but while doing select query then getting error

"Error getting access token for service account: Connection reset, iss: <>@<>.iam.gserviceaccount.com"

 

Please help me on this

0 1 11K
1 REPLY 1

Based on the error message, this "Connection reset" may be due to several different scenario:

1) Make sure your system clock is synchronized.

2) You should reuse the access token you get after the first successful authentication. You will get an invalid_grant error if your previous token has not expired yet. Cache it somewhere so you can reuse it.

3) Make sure that you pass the access token, and not refresh token as that fails. When you run, it turns the OAUth2 refresh token into an access token and passes that to the service. If you pass the raw refresh token, this is not acceptable for API access without turning it into a short-lived access token.

4) You might have reached the refresh token limit. Certain Google APIs have this, some explanation you can find here: https://developers.google.com/compute/docs/authentication