title: Server side authorization with Google Play Developer API?
body: <p>Authorization is required to fetch information from the <a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get" rel="noreferrer">Google Play Developer API</a>.</p>
  
  <p>I know how to do this with Postman, but implementing authorization is much more cumbersome (redirect url, handling redirects, and so on...)
  These would be the steps when you already have setup the auth data inside the <a href="https://console.developers.google.com/apis/dashboard" rel="noreferrer">Google Developer API Console</a>.</p>
  
  <pre><code>1.) GET https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&amp;response_type=code&amp;access_type=offline&amp;redirect_uri=http://www.myurl.com/oauth2callback&amp;client_id=1234567890.apps.googleusercontent.com
  2.) get code which was sent to redirect url. 
  3.) POST https://accounts.google.com/o/oauth2/token
  with
      grant_type:authorization_code
      code:[the code I got before]
      client_id:1234567890.apps.googleusercontent.com
      client_secret:[my client secret]
  4.) Invoke GET https://www.googleapis.com/androidpublisher/v2/applications/packageName/purchases/subscriptions/subscriptionId/tokens/token
  with:
    Scope: https://www.googleapis.com/auth/androidpublisher
  and:
    access_token as query parameter I got before.
  </code></pre>
  
  <p>Now I want to do all this programmatically. Obviously not so easy. I thought the <a href="https://developers.google.com/api-client-library/java/google-api-java-client/oauth2" rel="noreferrer">Google API Client Libraries</a> will help, but I don't see, how these lib can help me with my use case.<br>
  For example classes like <a href="https://developers.google.com/api-client-library/java/google-api-java-client/reference/1.20.0/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow" rel="noreferrer">GoogleAuthorizationCodeFlow</a> expect a user id at the moment of the request, but I not necessarily have one at this moment, so I wonder how this API should be used in a clean way.</p>
  
  <p>Is there a clean way to handle OAuth2.0 easier / programmatically with some API to access Google Play Developer API? Otherwise I must implement it manually.</p>