google-api-java-client

Unable to refresh access token : response is “unauthorized_client”

六眼飞鱼酱① 提交于 2019-11-29 11:28:31
问题 I am getting an error when I try to refresh access token: 400 Bad Request {error : "unauthorized_client"} From the Google token URI: { "error" : "invalid_request" } I read this answer here and the official Google documentation (which describes how a POST request should look) and I don't see any difference. I captured my POST request (secrets removed): POST /SHOWMERAWPOST HTTP/1.1 User-Agent: Google-HTTP-Java-Client/1.10.3-beta (gzip) Pragma: no-cache Host: requestb.in Content-Type:

Setting up Google-api-java-client developing environment

雨燕双飞 提交于 2019-11-29 08:52:12
I am trying the official example calendar-v2-atom-android . I have already import all dependency by using maven and it compile successfully. However, in run time , no class def found error occurs when it comes to private final List calendars = Lists.newArrayList(); private final HttpTransport transport = AndroidHttp.newCompatibleTransport(); It seems that it can't find the class in library in runtime. What should I do in eclipse? Thank You. Download the Google Api Java Client Create a libs folder in your eclipse project. Drag and drop all client files that do not end in -source into the libs

java.net.UnknownHostException Unable to resolve host “accounts.google.com”: No address associated with hostname while inserting rows in bigquery

被刻印的时光 ゝ 提交于 2019-11-29 07:05:57
问题 Hi I am working on android app in which I have integrated BigQuery. I see we are getting a lot of exception sometimes while inserting records in BigQuery tables. We are not expertise in this but started to learn this new technology. It would be great if you guys can help me on this. java.net.UnknownHostException: Unable to resolve host "accounts.google.com": No address associated with hostname at java.net.InetAddress.lookupHostByName(InetAddress.java:424) at java.net.InetAddress

Invalid grant when accessing Google API

爷,独闯天下 提交于 2019-11-29 07:03:25
I'm trying to invoke any of the Google API using "Service account" authorization access. I have downloaded ".pk2" file and activated "URL Shortener API" in Services tab of Google API console. Whenever I try to invoke any API (URL shortener or Adsense). I've got following exception - com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "invalid_grant" } at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105) at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:303) at com.google.api.client

“Login Required” 401 Unauthorized message when calling the v3 Google Calendar API using a Service Account via OAuth 2.0

情到浓时终转凉″ 提交于 2019-11-29 02:51:18
问题 First, let me explain what I am trying to do, as this is a two part question. I am building a JAX-RS service that internally authenticates with a Google account via OAuth2, so it can access and manipulate a Google calendar. This service will be called by a web site (Joomla), which will allow users that login into the site to register their email address with calendar events so they can get email notifications when the events are near. These users have no knowledge of the underlying Google

OAuth Google API for Java unable to impersonate user

大城市里の小女人 提交于 2019-11-28 23:48:59
I would like to impersonate a user and add files to the users Google Drive on their behalf from a server process. I've setup a service account and can successfully access the Drive as the service account adding and listing files, etc. using the following code: /** Global instance of the HTTP transport. */ private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); /** Global instance of the JSON factory. */ private static final JsonFactory JSON_FACTORY = new JacksonFactory(); public static void main(String[] args) { try { GoogleCredential credential = new GoogleCredential

Gmail atom feed with 2-legged OAuth receive 401 error

三世轮回 提交于 2019-11-28 19:01:28
We are experiencing the issue of Gmail atom feed with 2-legged OAuth, an error message is "401 unauthorized". The error message is like below. <HTML> <HEAD> <TITLE>Unauthorized</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Unauthorized</H1> <H2>Error 401</H2> </BODY> </HTML> Until last week, we have no problem using Gmail atom feed. From this week, we are experiencing the issue even though we have a no change regarding Gmail atom feed and oauth. Now, this problem do not occurs on all users(50,000 accounts), but this issue is increasing more and more. It seems that this problem is

Using Google Cloud Storage JSON api in android

我是研究僧i 提交于 2019-11-28 18:03:57
I want to upload image on Google Cloud Storage from my android app. For that I searched and found that GCS JSON Api provides this feature. I did a lot of research for Android sample which demonstrates its use. On the developer site they have provided code example that only support java. I don't know how to use that API in Android. I referred this and this links but couldn't get much idea. Please guide me on how i can use this api with android app. Ok guys so I solved it and got my images being uploaded in Cloud Storage all good. This is how: Note: I used the XML API it is pretty much the same.

Write to GoogleSheet via API with Java

ぃ、小莉子 提交于 2019-11-28 13:26:26
I am trying to write a value to a cell with Google Sheet API with Java. For reading I used guide from Java Quickstart which worked fine for me. For writing to Google Sheet I use: service.spreadsheets().values().update(spreadsheetId, "Sheet1!A4:H", response).execute(); This function outputs the following error while run: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Request had insufficient authentication scopes.", "reason" : "forbidden" } ], "message" : "Request had insufficient authentication

StorageServiceAccountSample application reports “KeyStore JKS implementation not found”

倖福魔咒の 提交于 2019-11-28 11:14:01
The very first line of StorageServiceAccountSample HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport(); causes the "KeyStore JKS implementation not found": W/System.err(20142): java.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore JKS implementation not found W/System.err(20142): at java.security.KeyStore.getInstance(KeyStore.java:119) W/System.err(20142): at com.google.api.client.util.SecurityUtils.getJavaKeyStore(SecurityUtils.java:48) W/System.err(20142): at com.google.api.client.googleapis.GoogleUtils.getCertificateTrustStore(GoogleUtils.java:74) W