title: Google+ login in android and then maintain offline session
body: <p><strong>Scope</strong></p>
  
  <p>I want to have google login in my app. For this I referred to <a href="https://developers.google.com/+/mobile/android/sign-in" rel="nofollow">https://developers.google.com/+/mobile/android/sign-in</a> and was able to create a basic login.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>Now, the problem is quite interesting. The login process works like a charm, but only when internet is connected. Lets get to a specific use case:</p>
  
  <ol>
  <li>I started the app, logged in with my xxxx@gmail.com.</li>
  <li>I closed the app, started again. It automatically logs in to xxxx@gmail.com. Technically: onConnected() gets called. (It has to be like this, no problem)</li>
  <li>I closed the app, and turned off the internet connectivity.</li>
  <li>Now again started the app the account gets logged out as I can see in logs: 'clearing selected account for *packagename' - (something related to this)</li>
  <li>I again switched on the internet connectivity and then started the app, nothing happens. It(the account) doesnt gets logged in (since it was logged out automatically).
  Technically: this time onConnectionFailed() gets called</li>
  </ol>
  
  <p>So, I want to keep this login even if the internet is switched off, what can I do?
  A couple of other apps do this stuff.</p>
  
  <p><strong>Self Digging</strong></p>
  
  <ol>
  <li>I went through the logs of other popular apps having google Login, and in which the login persists even if the internet is not connected and compared those logs with that of my apps' logs.</li>
  </ol>
  
  <p>Logs in Other apps:</p>
  
  <pre><code>  02-16 00:51:13.493: W/GLSUser(26959): [GLSUser] [GLSUser]  Permission for *packagename* to access oauth2:https://www.googleapis.com/auth/userinfo.email will be managed locally.
  </code></pre>
  
  <p>Logs in My apps:</p>
  
  <pre><code>   02-16 00:50:16.203: W/GLSUser(26959): [GLSUser] [GLSUser]  Permission for *packagename* to access oauth2:https://www.googleapis.com/auth/plus.me will be managed remotely.
  </code></pre>
  
  <ol start="2">
  <li><p>I found that this weird thing happens only when I am using scope =</p>
  
  <pre><code>Plus.SCOPE_PLUS_PROFILE
  </code></pre>
  
  <p>However, when I use scope = 'email' or 'profile' or Plus.SCOPE_PLUS_LOGIN. It works fine in offline mode.</p></li>
  </ol>
  
  <p>Can anybody help me ??</p>