title: How do I get id_token to properly load in Cloud Run?
body: <p>I have a Django app that I have been working on.  When I run it locally it runs perfectly.  When I run it in a container using Cloud Run I get the following error:</p>
  <p>'Credentials' object has no attribute 'id_token'</p>
  <p>Here is the offending code (payload is a dictionary object):</p>
  <pre><code>def ProcessPayload(payload):
    # Get authorized session credentials
    credentials, _ = google.auth.default()
    session        = AuthorizedSession(credentials)
    credentials.refresh(Request(session))
    # Process post request
    headers        = {'Authorization': f'Bearer {credentials.id_token}'}
    response       = requests.post(URL, json=payload, headers=headers)
  </code></pre>
  <p>In my local environment, the refresh properly loads credentials with the correct id_toled for the needed header, but for some reason when the code is deployed to Cloud Run this does not work.  I have the Cloud run instance set to use a service account so it should be able to get credentials from it.  How do I make this work? I have googled until my fingers hurt and have found no viable solutions.</p>