# google-auth 2.62.0 (Apache-2.0), harvested by tools/harvest_corpus.py
=== input
Credentials that use a JWT as the bearer token.

    These credentials require an "audience" claim. This claim identifies the
    intended recipient of the bearer token.

    The constructor arguments determine the claims for the JWT that is
    sent with requests. Usually, you'll construct these credentials with
    one of the helper constructors as shown in the next section.

    To create JWT credentials using a Google service account private key
    JSON file::

        audience = 'https://pubsub.googleapis.com/google.pubsub.v1.Publisher'
        credentials = jwt_async.Credentials.from_service_account_file(
            'service-account.json',
            audience=audience)

    If you already have the service account file loaded and parsed::

        service_account_info = json.load(open('service_account.json'))
        credentials = jwt_async.Credentials.from_service_account_info(
            service_account_info,
            audience=audience)

    Both helper methods pass on arguments to the constructor, so you can
    specify the JWT claims::

        credentials = jwt_async.Credentials.from_service_account_file(
            'service-account.json',
            audience=audience,
            additional_claims={'meta': 'data'})

    You can also construct the credentials directly if you have a
    :class:`~google.auth.crypt.Signer` instance::

        credentials = jwt_async.Credentials(
            signer,
            issuer='your-issuer',
            subject='your-subject',
            audience=audience)

    The claims are considered immutable. If you want to modify the claims,
    you can easily create another instance using :meth:`with_claims`::

        new_audience = (
            'https://pubsub.googleapis.com/google.pubsub.v1.Subscriber')
        new_credentials = credentials.with_claims(audience=new_audience)
    
=== parse google
short_description: 'Credentials that use a JWT as the bearer token.'
long_description: |
  These credentials require an "audience" claim. This claim identifies the
  intended recipient of the bearer token.
  
  The constructor arguments determine the claims for the JWT that is
  sent with requests. Usually, you'll construct these credentials with
  one of the helper constructors as shown in the next section.
  
  To create JWT credentials using a Google service account private key
  JSON file::
  
      audience = 'https://pubsub.googleapis.com/google.pubsub.v1.Publisher'
      credentials = jwt_async.Credentials.from_service_account_file(
          'service-account.json',
          audience=audience)
  
  If you already have the service account file loaded and parsed::
  
      service_account_info = json.load(open('service_account.json'))
      credentials = jwt_async.Credentials.from_service_account_info(
          service_account_info,
          audience=audience)
  
  Both helper methods pass on arguments to the constructor, so you can
  specify the JWT claims::
  
      credentials = jwt_async.Credentials.from_service_account_file(
          'service-account.json',
          audience=audience,
          additional_claims={'meta': 'data'})
  
  You can also construct the credentials directly if you have a
  :class:`~google.auth.crypt.Signer` instance::
  
      credentials = jwt_async.Credentials(
          signer,
          issuer='your-issuer',
          subject='your-subject',
          audience=audience)
  
  The claims are considered immutable. If you want to modify the claims,
  you can easily create another instance using :meth:`with_claims`::
  
      new_audience = (
          'https://pubsub.googleapis.com/google.pubsub.v1.Subscriber')
      new_credentials = credentials.with_claims(audience=new_audience)
blank_after_short_description: True
blank_after_long_description: False
style: google
=== detect
rest
=== compose google
Credentials that use a JWT as the bearer token.

These credentials require an "audience" claim. This claim identifies the
intended recipient of the bearer token.

The constructor arguments determine the claims for the JWT that is
sent with requests. Usually, you'll construct these credentials with
one of the helper constructors as shown in the next section.

To create JWT credentials using a Google service account private key
JSON file::

    audience = 'https://pubsub.googleapis.com/google.pubsub.v1.Publisher'
    credentials = jwt_async.Credentials.from_service_account_file(
        'service-account.json',
        audience=audience)

If you already have the service account file loaded and parsed::

    service_account_info = json.load(open('service_account.json'))
    credentials = jwt_async.Credentials.from_service_account_info(
        service_account_info,
        audience=audience)

Both helper methods pass on arguments to the constructor, so you can
specify the JWT claims::

    credentials = jwt_async.Credentials.from_service_account_file(
        'service-account.json',
        audience=audience,
        additional_claims={'meta': 'data'})

You can also construct the credentials directly if you have a
:class:`~google.auth.crypt.Signer` instance::

    credentials = jwt_async.Credentials(
        signer,
        issuer='your-issuer',
        subject='your-subject',
        audience=audience)

The claims are considered immutable. If you want to modify the claims,
you can easily create another instance using :meth:`with_claims`::

    new_audience = (
        'https://pubsub.googleapis.com/google.pubsub.v1.Subscriber')
    new_credentials = credentials.with_claims(audience=new_audience)
