-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Stuck with providing valid client credentials #175
Comments
Also having this same issue. Applying this configuration: terraform {
required_providers {
commercetools = {
source = "labd/commercetools"
}
}
}
provider "commercetools" {
client_id = "id"
client_secret = "secret"
project_key = "my-project"
scopes = "manage_project:my-project"
api_url = "https://api.us-central1.gcp.commercetools.com"
token_url = "https://auth.us-central1.gcp.commercetools.com"
}
resource "commercetools_product_type" "apparel" {
name = "Apparel"
description = "The generic product type."
key = "apparel"
} Results in this error:
Omitting the provider block and using environment variables results in the same error. Terraform version:
|
We need to look into this. Do you see anything related when you run |
Logs say "encountered an error during creation".
The full output: out.txt One thing that seemed strange was the "apparel" product type in my configuration above already exists in my CT project, yet terraform said it was planning to create the product type and not modify it. I'm new to terraform, so I'm not sure if this is expected behavior or not; regardless, I changed the resource to a type that doesn't exist and got the same error. Edit: Not sure if this is logged or not, but I did not see a request to the CT token endpoint. |
We also had this issue and found the solution was to have multiple scopes defined. We tried an empty string and
|
I can't reproduce this. Using the admin token works perfect here. Did you make sure that the scopes you define here match the scopes you defined when creating the token in the commercetools merchant center? The only explanation for me is that there is a mismatch there. Otherwise I think you need to get commercetools support involved. |
Managed to get a working setup with following terraform, by appending authentication in token_url example in this other issue: |
Hi,
I'm playing around with your provider for commercetools on a playground. I created a test project in Commercetools and also an API user (scope: manage_project).
While I'm able to authenticate via
curl
, Terraform is throwing fits when trying to use the same credentials, scopes, URLs etc. in theprovider
block.curl:
In Terraform I'm using the provider block and a basic tax category:
Unfortunately Terraform is not creating the resource because either it's not transmitting the credentials correctly or CT is not accepting them.
I also tried to create the same resource without using the
provider
block and instead set environment variables likeCTP_PROJECT_KEY
etc. That works fine.I'm using
The text was updated successfully, but these errors were encountered: