0

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.

Crazy-Coder
  • 107
  • 1
  • 1
  • 9

1 Answers1

0

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.

DoiT International
  • 2,405
  • 1
  • 20
  • 24
  • @ Vadim Solovey Thank you sir.That's kind of ray of Hope. All I could get is, I have to make a POST REST request. do you think I can create OAuthId and Service key(P12) also by some code instead of manual settings ? – Crazy-Coder Feb 10 '16 at 08:48
  • .May you please suggest then how just other app ask permission for different-2 clients and directly allow them to use their services . I think they would have been creating new project and new OAuth and P12 automatically and seperatly and somehow not manually in developer console for different-2 clients ? your suggestion please – Crazy-Coder Feb 10 '16 at 10:05
  • Unfortunately, you cannot create credentials such as OAuth and/or Service Accounts using the 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. – DoiT International Feb 10 '16 at 10:21
  • sir, make sense, Thanks a ton for your kind reply, right now for every new customer, we make new account, generate P12 key and store in DB, make OAuthId and setup some recurring batch, all manually in Google Console Developer.this is kind of hassle for new clients and their Admin department to follow these steps.This way I was planning to make an app that will make some of these process automate.if could suggest some way, any suggestion I will be highly oblige to you – Crazy-Coder Feb 10 '16 at 11:08
  • @HimanshuTripathi, unfortunately there is no way of automating this at this moment. I have updated my answer to reflect this as well. If this is useful to you, please upvote. – DoiT International Feb 10 '16 at 11:24
  • @ Vadim Solovey Sir Thank you so much once again.Already 'voted up' but as my reputation is <15 it will taken as anonymous users. – Crazy-Coder Feb 10 '16 at 11:50
  • finally done with app, after research I found there is no need to make new developer console project again n again for new clients using code n all. Just ask the grants n domain access from user. once App-user accept it , its done you get access the client's domain, concept is known as 'Domain-wise-delegation' Thanks all – Crazy-Coder Feb 24 '16 at 09:12