title: GoogleCredential deprecation
body: <p>We want to implement Google OAUTH to play nicely with our web-app based credentials. Flow starts on UI side, which shows user consent screen, and then we obtain a code. That code is then sent to our java based back-end to get refresh token.</p>
  <p>At the moment we use this approach:</p>
  <pre class="lang-java prettyprint-override"><code> private Analytics getAnalytics(String refreshToken) throws Exception {
  
          NetHttpTransport httpTransport =
                  GoogleNetHttpTransport.newTrustedTransport();
  
          JsonFactory jsonFactory =
                  JacksonFactory.getDefaultInstance();
  
          return new Analytics.Builder(
                  httpTransport,
                  jsonFactory,
                  new GoogleCredential.Builder()
                          .setTransport(httpTransport)
                          .setJsonFactory(jsonFactory)
                          .setClientSecrets(clientId, clientSecret)
                          .build()
                          .setRefreshToken(refreshToken)
          ).build();
      }
  </code></pre>
  <p>The problem in above is that GoogleCredential is deprecated. What is they non-deprecated way to do this?</p>
  <p>We are using following lib:</p>
  <pre><code>com.google.apis.google-api-services-analytics:v3-rev20190807-1.30.10
  </code></pre>