Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to create a oauth client id for gcp programmatically

I can create OAuth2.0 Client IDs and Client Secret with Authorized redirect URIs using the GUI in GCP.. The Console URL is given below for reference

https://console.cloud.google.com/apis/credentials

How do we do this in cloud shell or with the GCloud SDK

like image 943
Rajkumar Purushothaman Avatar asked Jul 27 '18 00:07

Rajkumar Purushothaman


2 Answers

As of terraform-provider-google version 3.15, you can do this using the google_iap_client resource:

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/iap_client


resource "google_iap_brand" "project_brand" {
  support_email     = "[email protected]"
  application_title = "Cloud IAP protected Application"
  project           = google_project_service.project_service.project
}

resource "google_iap_client" "project_client" {
  display_name = "Test Client"
  brand        =  google_iap_brand.project_brand.name
}
like image 169
Symmetric Avatar answered Nov 10 '22 16:11

Symmetric


It seems that no API from Google can manage OAuth client ID or Credentials related configuration.

I've not found any on API Library and many other questions related to this give the same answer (can't manage API Key for example).

If you're a Terraform user, they're an open issue on Google Provider: https://github.com/terraform-providers/terraform-provider-google/issues/1287

like image 44
Seboudry Avatar answered Nov 10 '22 16:11

Seboudry