Google Contacts API - failing to refresh access token
问题 We use Google Contacts API with OAuth2: credential = new GoogleCredential.Builder().setTransport(new NetHttpTransport()) .setJsonFactory(new JacksonFactory()) .setClientSecrets(OAuth2ClientId(), OAuth2ClientSecret()) .addRefreshListener(new CredentialRefreshListener() {...}); myService = new ContactsService("My-App"); myService.setOAuth2Credentials(credential); and quite regularly we receive '401 Unauthorized' response that the GData library can't handle. AuthenticationException throws NPE