Code sometimes needs to determine the identifier of the application in which it is executing. This may be to generate a URL or email address, or possibly to make some run-time decision. App Engine includes an Application Identity service for this purpose.
- Identifying itself
- Asserting identity to other App Engine apps
- Asserting identity to Google APIs
- Asserting identity to other systems
Identifying itself
Application ID
The application ID can be found using the
getApplicationId()
method.
Versioned hostnames
A related operation is the need to get the hostname part of a URL to the application. You can use the
getDefaultVersionHostname()
method for this purpose. This is useful in certain scenarios when the application is not available at
http://your_app_id.appspot.com
.