Google Cloud Platform API to configure OAuth2 consent and credentials
Asked Answered
M

2

9

The Oauth2 setup help says to use the https://console.cloud.google.com/apis/credentials page to setup credentials for Oauth2. However I can find no documentation on any RESTful or gRPC API to accomplish the same goal. Does anyone know if this exists?

Does anyone know of an API to setup the consent screen?

I use the Terraform Google provider to configure my GCloud platform, does anyone know of a resource to control this?

Mispleading answered 28/10, 2019 at 0:19 Comment(0)
C
11

However I can find no documentation on any RESTful or gRPC API to accomplish the same goal. Does anyone know if this exists?

There is no public API. Setting up OAuth Client Secrets must be performed in the Console.

Does anyone know of an API to setup the consent screen?

There is no public API.

I use the Terraform Google provider to configure my GCloud platform, does anyone know of a resource to control this?

If you mean that you want to use Terraform to set up OAuth, since there is no public API, there is no Terraform feature for this.

Calciferous answered 28/10, 2019 at 4:1 Comment(1)
Well that really sucks. :-( Makes GitOps impossibleMispleading
S
9

You can now do this (for Organization internal IAP bits) with the following resources:

  • google_iap_brand - For configuring your IAP Brand (Consent screen stuff)
  • google_iap_client - For creating IAP Clients (Though do note that all Service Accounts come with an OAuth Client ID, if you have a OAuth consent screen configured)
  • google_iap_*_iam_*, for example: google_iap_web_client_iam_member - For handling IAM rules for those accessing things through your OAuth client.
Snood answered 28/6, 2023 at 11:42 Comment(3)
The OP asked about specifically asked about: console.cloud.google.com/apis/credentials Your suggestion does not address those.Mispleading
I disagree. The Credentials console is for setting up API Keys and OAuth Client IDs. The question is OAuth specific. My second bullet point links to a terraform resource to setup OAuth Client IDs.Snood
I will second @Harmelodic. The resources listed will address the OAuth consent screen and OAuth 2.0 Client ID. The other part (api key generation) is just not suitable to be implemented through API since it has a fundamental security problem.Puiia

© 2022 - 2025 — McMap. All rights reserved.