Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not create google_identity_platform_default_supported_idp_config #5390

Closed
courteouselk opened this issue Jan 13, 2020 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#2969
Assignees
Labels

Comments

@courteouselk
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.12.19
+ provider.google v3.4.0
+ provider.google-beta v3.4.0
+ provider.null v2.1.2
+ provider.random v2.2.1
+ provider.template v2.1.2

Affected Resource(s)

  • google_identity_platform_default_supported_idp_config

Terraform Configuration Files

resource "google_identity_platform_default_supported_idp_config" "google_idp" {
  project       = "project"
  enabled       = true
  # Use the values from GCP Console -> API & Services -> Credentials -> Web client
  client_id     = "000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"
  client_secret = "xxxxxxxxxxxxxxxxxxxxxxxx"
}

Debug Output

---[ REQUEST ]---------------------------------------
POST /v2/projects/project/defaultSupportedIdpConfigs?alt=json&idpId=000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com HTTP/1.1
Host: identitytoolkit.googleapis.com
User-Agent: HashiCorp Terraform/0.12.19 (+https://www.terraform.io) Terraform Plugin SDK/1.4.0 terraform-provider-google/3.4.0
Content-Length: 145
Content-Type: application/json
Accept-Encoding: gzip

{
 "clientId": "000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
 "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxx",
 "enabled": true
}

-----------------------------------------------------
2020/01/13 13:15:45 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request
Alt-Svc: quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json; charset=UTF-8
Date: Mon, 13 Jan 2020 12:15:45 GMT
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 400,
    "message": "INVALID_PROVIDER_ID : Invalid Idp name",
    "status": "INVALID_ARGUMENT"
  }
}

-----------------------------------------------------

Expected Behavior

The google IDP configuration should have been created.

Actual Behavior

terraform apply fails with an error:

Error: Error creating DefaultSupportedIdpConfig: googleapi: Error 400: INVALID_PROVIDER_ID : Invalid Idp name

on ../../modules/frontend-shared/identity-providers.tf line 2, in resource "google_identity_platform_default_supported_idp_config" "google_idp":
2: resource "google_identity_platform_default_supported_idp_config" "google_idp" {

I guess this is because the expected provider name for the default supported IDP is google.com (this is what it gets when created by hand), while the provider tries to assign it the same name as the client_id argument is.

Steps to Reproduce

  1. terraform apply
@ghost ghost added the bug label Jan 13, 2020
@slevenick
Copy link
Collaborator

Looks like I did not correctly understand this resource when I implemented it.

I'm fixing via a PR to add a new field idp_id that is separate from client_id. idp_id should be the identifier of the IDP, for instance google.com

@ghost
Copy link

ghost commented Feb 14, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants