title: How to obtain oauth 2.0 token from google plus api in android?
body: <p>I have a problem with obtaining oauth 2.0 token from google API. I am currently writing app for <strong>android</strong>, where I want to have three methods of signing in - via facebook (done), via custom oauth 2.0 provider (also done) and via google plus - it makes many problems for me.
  I need to get access token on the device, and pass it further to backend application.</p>
  
  <p>I tried using GoogleApiClient (PlusClient is deprecated - via 
  <a href="http://developer.android.com/reference/com/google/android/gms/plus/PlusClient.html" rel="nofollow">http://developer.android.com/reference/com/google/android/gms/plus/PlusClient.html</a>), but cannot see a method like getAccessToken or something similar. </p>
  
  <p>Currently i try to use socialauth library, but I'm stuck due to lack of documentation (here is some code)</p>
  
  <pre><code>private SocialAuthAdapter mSocialAdapter;
  ... in onCreate()
  mSocialAdapter = new SocialAuthAdapter(new GooglePlusSocialAuthListener());
  try {
      mSocialAdapter.addConfig(Provider.GOOGLEPLUS, key_from_google_developers_console, secret, 
      "https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/userinfo.email");
      mSocialAdapter.addCallBack(Provider.GOOGLEPLUS, 
     "http://localhost:3000/api/auth/gplus/callback");
  }
  catch (Exception e) {
     e.printStackTrace();
  }
  
  mSocialAdapter.authorize(LoginActivity.this, Provider.GOOGLEPLUS);
  Log.e("TOKEN HERE ", mSocialAdapter.getCurrentProvider().getAccessGrant().getKey());
  </code></pre>
  
  <p>Can anybody help me to get this token? It doesn't matter if it is via socialauth or via GoogleApiClient.</p>