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

Impossible to create some cloudflare_zero_trust resources due to error "auth.key_not_in_claims (1007)" #4316

Closed
3 tasks done
MrTrustor opened this issue Oct 18, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. service/access Categorizes issue or PR as related to the Access service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced

Comments

@MrTrustor
Copy link

MrTrustor commented Oct 18, 2024

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.9.8
on linux_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v4.44.0

Affected resource(s)

  • cloudflare_zero_trust_access_identity_provider
  • cloudflare_zero_trust_access_group
  • cloudflare_zero_trust_access_application

Terraform configuration files

resource "cloudflare_zero_trust_access_group" "example" {
  account_id = var.cloudflare_account_id
  name       = "example"

  include {
    email = ["[email protected]", "[email protected]"]
  }
}

resource "cloudflare_zero_trust_access_application" "foobar" {
  account_id       = var.cloudflare_account_id
  name             = "foobar"
  domain           = cloudflare_record.foobar.hostname
  type             = "self_hosted"
  session_duration = "12h"
  policies         = ["example"]
}

resource "cloudflare_zero_trust_access_identity_provider" "google_oauth" {
  account_id = var.cloudflare_account_id
  name       = "Google"
  type       = "google"
  config {
    client_id     = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"
    client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}

Link to debug output

https://gist.github.com/MrTrustor/b7256e9066dbfb2d7317f48ec00a32ba

Panic output

No response

Expected output

I expect to be able to create the 3 resources listed above.

Actual output

The creation of any one of those resources fails with the error message:

failed to create Access Identity Provider: error from makeRequest: auth.key_not_in_claims (1007)

Steps to reproduce

  1. Try to create one of the resources listed by running terraform apply
  2. Observe that the creation fails

Additional factoids

The Account API Token I'm using with Terraform has the following permissions:

  • Account: Cloudflare Tunnel - Edit
  • Account: Zero Trust - Edit
  • Account: Access: Organizations, Identity Providers, and Groups - Edit
  • Account: Access: Apps and Policies - Edit
  • Zone: Zone Settings - Edit
  • Zone: Zone - Edit
  • Zone: SSL and Certificates - Edit
  • Zone: DNS - Edit

Someone else seem to be running into the same issue:

References

No response

@MrTrustor MrTrustor added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 18, 2024
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Oct 18, 2024
@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. service/access Categorizes issue or PR as related to the Access service. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 18, 2024
@MrTrustor
Copy link
Author

It turns out the issue was that I was using a Account API Token. I created a User API Token, with exactly the same permissions, and it worked.
I don't know if that's an expected behavior, but me finding that was basically a stroke of luck.

@jacobbednarz
Copy link
Member

can confirm this is due to account owned tokens and that access does not yet fully support it. the team is working on adding support but in the meantime, you'll need to provide user tokens or the API key/email combo. once the team lands support, this will just work without changes on your side.

@jacobbednarz jacobbednarz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. service/access Categorizes issue or PR as related to the Access service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced
Projects
None yet
Development

No branches or pull requests

2 participants