title: Why I'm Getting Refresh Token for 1 hour only?
body: <p>I am trying to get data of user of Google AdSense using OAuth2 and I have followed all the Documentation which is <a href="https://developers.google.com/identity/sign-in/android/start-integrating" rel="nofollow noreferrer">here</a>.</p>
  <p>And I successfully get all response which is expected but the problem is that the refresh token is expired within access token as access token expires after 1 hour and I'm unable to make another access token request from refresh token because it also expires.</p>
  <p><strong>In one line, Refreh Token expires after 1 hour and user needs to login again. That's main problem.</strong></p>
  <p><a href="https://stackoverflow.com/questions/50903787/how-to-get-an-access-token-using-a-refresh-token-in-java">The Code I have tried to get access token from refresh token</a>:</p>
  <pre><code>public TokenResponse refreshAccessToken(String refreshToken) throws IOException {
      TokenResponse response = new GoogleRefreshTokenRequest(
              new NetHttpTransport(),
              new JacksonFactory(),
              refreshToken, 
              &quot;your clientId&quot;,
              &quot;your clientSecret&quot;)
              .execute();
      System.out.println(&quot;Access token: &quot; + response.getAccessToken());
  
      return response;
  }
  </code></pre>
  <p><a href="https://github.com/coderscoding/myapp" rel="nofollow noreferrer">Here's is app activity code</a>.</p>
  <p>I have tried many searches but they didn't help.
  <strong>If there is any other method to get the access token, please help me to reach out there.</strong></p>
  <p>Thanks In Advance.</p>
  <p><em>Any other working way would be Gold for me.</em></p>
  <p><strong>=========================== UPDATE ========================</strong></p>
  <p><em>I have got my mistake in my project.</em></p>