Open Ramguru94 opened 1 year ago
2023-08-17T16:10:41.860+0200 [INFO] provider.terraform-provider-restapi_v1.18.1: 2023/08/17 16:10:41 api_client.go: Request headers:: timestamp=2023-08-17T16:10:41.860+0200
2023-08-17T16:10:41.860+0200 [INFO] provider.terraform-provider-restapi_v1.18.1: 2023/08/17 16:10:41 api_client.go: Content-Type: application/json: timestamp=2023-08-17T16:10:41.860+0200
2023-08-17T16:10:41.860+0200 [INFO] provider.terraform-provider-restapi_v1.18.1: 2023/08/17 16:10:41 api_client.go: BODY:: timestamp=2023-08-17T16:10:41.860+0200
the BODY part looks empty ?
I am fighting with the very same problem. Did you find a solution for this?
resource "restapi_object" "get_token" { path = "/api/oauth2/token" debug = true data = jsonencode({ grant_type = "password" username = var.user password = var.pwd refresh_token = "" code = "" use_short_term_refresh = "" vbr_token = "" }) }
Error: unexpected response code '400': { │ "errorCode": 0, │ "message": "TokenLoginSpec.GrantType : 'Grant Type' must not be empty. ", │ "resourceId": null │ } │ │ with restapi_object.get_token, │ on mastercard.tf line 22, in resource "restapi_object" "get_token": │ 22: resource "restapi_object" "get_token" {
unexpected response code '400': {"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: 'grant_type'.
I am trying to create Bearer token for a Azure service principal.
Provider.tf contains
resource.tf contains
My data has grant_type set and still i am getting 400
Am i missing something or doing this wrong!