terraform-provider-restapi icon indicating copy to clipboard operation
terraform-provider-restapi copied to clipboard

Oauth insecure

Open tcoupin opened this issue 3 years ago • 0 comments

Hi,

first : thank you for your work!

I try to use Oauth authentication with an unsecure api but token endpoint is unsecure too.

Configuration

terraform {
  required_providers {
    restapi = {
      source = "Mastercard/restapi"
      version = "1.16.2"
    }
  }
}


provider "restapi" {
  uri = "https://10.4.3.150"
  insecure = true
  debug = true
  oauth_client_credentials {
      oauth_client_id = "*****"
      oauth_client_secret = "*****"
      oauth_token_endpoint = "https://10.4.3.150/api/oauth/token"
      oauth_scopes = ["openid"]
  }
}

data "restapi_object" "list_clients" {
  path = "/api/v1/clients"
  search_key = "content"
  search_value = "name"
  query_string = "domain=%2Fvcenter.ird-cines.local&fields=id%2Cname&paged=false&recursive=false&size=10000"
}

Error

> terraform plan
╷
│ Error: Post "https://10.4.3.150/api/oauth/token": x509: cannot validate certificate for 10.4.3.150 because it doesn't contain any IP SANs
│ 
│   with data.restapi_object.list_clients,
│   on conf.tf line 25, in data "restapi_object" "list_clients":
│   25: data "restapi_object" "list_clients" {
│ 
╵

tcoupin avatar Apr 27 '22 07:04 tcoupin