title: "'Credentials' object has no attribute 'access_token'" when using google-auth with gspread
body: <p>I'd like to use <a href="http://gspread.readthedocs.io/en/latest/" rel="noreferrer"><code>gspread</code></a> module to edit Google sheets from Python. The <a href="http://gspread.readthedocs.io/en/latest/oauth2.html" rel="noreferrer">setup instructions</a> contain the following example:</p>
  
  <pre><code>import gspread
  from oauth2client.service_account import ServiceAccountCredentials
  
  scope = ['https://spreadsheets.google.com/feeds',
           'https://www.googleapis.com/auth/drive']
  
  credentials = ServiceAccountCredentials.from_json_keyfile_name('gspread-april-2cd … ba4.json', scope)
  
  gc = gspread.authorize(credentials)
  </code></pre>
  
  <p>However, according to <a href="https://pypi.org/project/oauth2client/" rel="noreferrer">https://pypi.org/project/oauth2client/</a> the <code>oauth2client</code> library is deprecated. So I've tried to adapt this as follows, using <a href="https://google-auth.readthedocs.io/" rel="noreferrer"><code>google-auth</code></a>:</p>
  
  <pre><code>import gspread
  from google.oauth2 import service_account
  
  credentials = service_account.Credentials.from_service_account_file(
      'my_client_secrets.json')
  
  scoped_credentials = credentials.with_scopes(
      ['https://www.googleapis.com/auth/spreadsheets'])
  
  gc = gspread.authorize(scoped_credentials)
  </code></pre>
  
  <p>Unfortunately, I'm running into the following error:</p>
  
  <pre><code>(lucy-web-CVxkrCFK) bash-3.2$ python nps.py
  Traceback (most recent call last):
    File "nps.py", line 54, in &lt;module&gt;
      gc = gspread.authorize(scoped_credentials)
    File "/Users/kurtpeek/.local/share/virtualenvs/lucy-web-CVxkrCFK/lib/python3.7/site-packages/gspread/__init__.py", line 38, in authorize
      client.login()
    File "/Users/kurtpeek/.local/share/virtualenvs/lucy-web-CVxkrCFK/lib/python3.7/site-packages/gspread/client.py", line 46, in login
      if not self.auth.access_token or \
  AttributeError: 'Credentials' object has no attribute 'access_token'
  </code></pre>
  
  <p>If I drop into the debugger, I indeed see that <code>credentials</code> has a <code>token</code> attribute, but not an <code>access_token</code> one:</p>
  
  <pre><code>&gt; /Users/kurtpeek/Documents/Dev/lucy2/lucy-web/scripts/nps.py(54)&lt;module&gt;()
       53 import ipdb; ipdb.set_trace()
  ---&gt; 54 gc = gspread.authorize(scoped_credentials)
       55 
  
  ipdb&gt; type(credentials)
  &lt;class 'google.oauth2.service_account.Credentials'&gt;
  ipdb&gt; type(scoped_credentials)
  &lt;class 'google.oauth2.service_account.Credentials'&gt;
  ipdb&gt; dir(credentials)
  ['__abstractmethods__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_abc_impl', '_additional_claims', '_from_signer_and_info', '_make_authorization_grant_assertion', '_project_id', '_scopes', '_service_account_email', '_signer', '_subject', '_token_uri', 'apply', 'before_request', 'expired', 'expiry', 'from_service_account_file', 'from_service_account_info', 'has_scopes', 'project_id', 'refresh', 'requires_scopes', 'scopes', 'service_account_email', 'sign_bytes', 'signer', 'signer_email', 'token', 'valid', 'with_claims', 'with_scopes', 'with_subject']
  </code></pre>
  
  <p>Are the <code>Credentials</code> generated by <code>google-auth</code> not the same objects as the ones generated by <code>oauth2client</code>?</p>