Python 3.9 is now generally available.

google.appengine.api.app_identity.get_access_token

The OAuth 2.0 access token to act on behalf of the application.

Each application has an associated Google account. This function returns an OAuth 2.0 access token that corresponds to the running app. Access tokens are safe to cache and reuse until their expiry time as returned.

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

A Pair, Access token string and the expiration time in seconds since the epoch.

InvalidScope If the scopes are unspecified or invalid.