Add default for OAuth 2.0 parameter access_type of offline.

Reviewed in http://codereview.appspot.com/5316073/.
diff --git a/oauth2client/client.py b/oauth2client/client.py
index 3d81a8c..d77e776 100644
--- a/oauth2client/client.py
+++ b/oauth2client/client.py
@@ -641,7 +641,10 @@
     self.user_agent = user_agent
     self.auth_uri = auth_uri
     self.token_uri = token_uri
-    self.params = kwargs
+    self.params = {
+        'access_type': 'offline',
+        }
+    self.params.update(kwargs)
     self.redirect_uri = None
 
   def step1_get_authorize_url(self, redirect_uri='oob'):
diff --git a/tests/test_oauth2client.py b/tests/test_oauth2client.py
index 4063e8b..a23d1da 100644
--- a/tests/test_oauth2client.py
+++ b/tests/test_oauth2client.py
@@ -191,6 +191,26 @@
     self.assertEqual(q['response_type'][0], 'code')
     self.assertEqual(q['scope'][0], 'foo')
     self.assertEqual(q['redirect_uri'][0], 'oob')
+    self.assertEqual(q['access_type'][0], 'offline')
+
+  def test_override_flow_access_type(self):
+    """Passing access_type overrides the default."""
+    flow = OAuth2WebServerFlow(
+        client_id='client_id+1',
+        client_secret='secret+1',
+        scope='foo',
+        user_agent='unittest-sample/1.0',
+        access_type='online'
+        )
+    authorize_url = flow.step1_get_authorize_url('oob')
+
+    parsed = urlparse.urlparse(authorize_url)
+    q = parse_qs(parsed[4])
+    self.assertEqual(q['client_id'][0], 'client_id+1')
+    self.assertEqual(q['response_type'][0], 'code')
+    self.assertEqual(q['scope'][0], 'foo')
+    self.assertEqual(q['redirect_uri'][0], 'oob')
+    self.assertEqual(q['access_type'][0], 'online')
 
   def test_exchange_failure(self):
     http = HttpMockSequence([