Unable to get token using Google APIs [google-oauth-java-client-1.12.0-beta] for service account flow
问题 I am using Google APIs (version google-oauth-java-client-1.12.0-beta) to get a OAuth2 access token but got back "invalid_grant". Ref: https://developers.google.com/accounts/docs/OAuth2ServiceAccount Here is the code: import com.google.api.client.auth.jsontoken.JsonWebSignature; import com.google.api.client.auth.jsontoken.JsonWebToken; import com.google.api.client.auth.jsontoken.RsaSHA256Signer; import com.google.api.client.auth.oauth2.TokenRequest; import com.google.api.client.auth.oauth2