Error getting access token for service account: 401 Unauthorized while calling refresh on Google Credentials
I am using a service account to access the google cloud features like Drive and Contact to save data through my app. I have suddenly started getting this for all users of some clients. Rest of them seem to be working fine.
"exception_class": "com.google.auth.oauth2.GoogleAuthException",
"exception_message": "Error getting access token for service account: 401 Unauthorized
POST https://accounts.google.com/o/oauth2/token, iss: XXXX.iam.gserviceaccount.com
...
Caused by: com.google.api.client.http.HttpResponseException: 401 Unauthorized
POST https://accounts.google.com/o/oauth2/token
... suppressed 3 lines
... 61 more
Was and still working fine for certain clients, failing for all users of the other client. What setting should I verify? Domain wide delegation is correct. Clients say they haven't changed any setting on their end.
Hi @nusbahcodes, thanks for reporting this issue. Could we get some code snippets and dependency versions to help us debug this issue? Specifically the versions of the auth library and client libraries (drive + contact).
At first glance, the token endpoint seems odd. I was expecting https://oauth2.googleapis.com/token, but it may by due to an older version of the auth library.
Lib versions: google-auth-library-oauth2-http-1.23.0.jar google-api-services-drive-v3-rev20221023-2.0.0.jar
Thanks, but I would need some code snippets to figure out how you're using the library. Would you be able to share that to help with debugging?
We have raised a support case for the same.
I am also receiving this error. Is there any known or temporary fix for this?
I am also receiving this error. Is there any known or temporary fix for this?
Apologies, I missed this message. If this is still an issue, can you provide a repro or code samples to help with investigating this?
Closing this issue due to inactivity. Feel free to re-open if there are any updates or more information