English ▼
Skip to page content Skip to main navigation
e.g. "templates" or "datastore"

# App Identity Module Functions

The `google.appengine.api.app_identity` package provides the following function:

get_access_token(scopes)

  Gets an OAuth2 access token to act on behalf of the application.

  Arguments:

  scopes
    The requested API scope string, or a list of strings.

  Returns tuple, access token (string) and expiration time (seconds since the epoch). The access token will be cached across multiple calls using memcache.

get_application_id()

  Returns the application ID.

get_default_version_hostname()

  Returns the standard hostname of the default version of the application. For example, if your application ID is `your_app_id` then this function returns a string similar to `your_app_id.appspot.com`.

get_public_certificates(deadline=None)

  Gets public certificates.

  Arguments:

  deadline=None
    Optional deadline in seconds to get the public certificates; the default is system specific (typically 5 seconds).

  Returns a list of currently valid PublicCertificate objects. Each PublicCertificate has a key_name and x509_certificate_pem property.

get_service_account_name(deadline=None)

  Gets service account name of the app.

  Arguments:

  deadline=None
    Optional deadline in seconds to get the account name of the service; the default is system specific (typically 5 seconds).

  Returns the service account name of the app.

sign_blob(bytes_to_sign, deadline=None)

  Signs a blob.

  Arguments:

  bytes_to_sign
    A blob to sign.
  deadline=None
    Optional deadline in seconds to sign a blob; the default is system specific (typically 5 seconds).

  Returns a tuple, a signing key name, and a signature.