Search code examples
google-app-enginegoogle-apigoogle-appsgoogle-apps-marketplacegoogle-developer-tools

How to make new project inside google developer console using JS or Java with some google API


I want to create new project and other Auth configuration using code from js file or Java unlike manual creation. How can I do that? whether is it feasible or not?

This is what my app will do when someone will install it from marketplace.


Solution

  • The projects.create() (POST https://cloudresourcemanager.googleapis.com/v1beta1/projects) method creates a Project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the Project.

    However, please note that the projects.create() method is in the alpha stage. It might be changed in backward-incompatible ways and is not recommended for production use.

    Unfortunately, you cannot create credentials such as OAuth and/or Service Accounts using the same API. I think it's a classic egg-and-the-chicken situation because to access that kind of API you would need to have a credentials first to authenticate, right? Otherwise, everyone could create credentials in unauthorized domains.