Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now available in preview.

Module: google.appengine.api.app_identity

The App Identity API lets an application discover its application ID.

Using the ID, an App Engine application can assert its identity to other App Engine Apps, Google APIs, and third-party applications and services. The application ID can also be used to generate a URL or email address, or to make a run-time decision.

The application ID is the same as the project ID. To learn more about the App Identity API, read the App Identity Python Overview:


app_identity module: Provides access functions for the app identity service.

app_identity_defaultcredentialsbased_stub module: App identity stub service implementation.

app_identity_keybased_stub module: App identity stub service implementation.

app_identity_stub module: App identity stub service implementation.

app_identity_stub_base module: Base class and constants for app identity stubs.


class BackendDeadlineExceeded: The communication to the backend service timed out.

class BlobSizeTooLarge: The size of the blob to sign is larger than the allowed limit.

class Error: Base error type.

class InternalError: An unspecified internal failure occurred.

class InvalidScope: The scope is invalid.

class NotAllowed: The operation is not allowed.

class OperationNotImplemented: The operation is not implemented for the service account.

class PublicCertificate: Class that specifies information about a public certificate.


create_rpc(...): Creates an RPC object for use with the App Identity API.

get_access_token(...): The OAuth 2.0 access token to act on behalf of the application.

get_application_id(...): Gets the application ID of an app.

get_default_gcs_bucket_name(...): Gets the default Google Cloud Storage bucket name for the app.

get_default_version_hostname(...): Gets the standard host name of the default version of the app.

get_public_certificates(...): Gets public certificates.

get_service_account_name(...): Gets the service account name of the app.

make_get_default_gcs_bucket_name_call(...): Gets the default Google Cloud Storage bucket name for the app.

make_get_public_certificates_call(...): Executes the RPC call to get a list of public certificates.

make_get_service_account_name_call(...): Gets the service account name of the app.

make_sign_blob_call(...): Executes the RPC call to sign a blob.

sign_blob(...): Signs a blob.