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

client_id not working on Application create #205

Open
M-Whitaker opened this issue May 11, 2023 · 2 comments
Open

client_id not working on Application create #205

M-Whitaker opened this issue May 11, 2023 · 2 comments

Comments

@M-Whitaker
Copy link

As per the api specification, fusion auth supports supplying a client_id and client_secret: https://fusionauth.io/docs/v1/tech/apis/applications#create-an-application.

It looks like from my testing and reading a bit of the code (very new to terraform so maybe reading wrong) the provider doesn't support this field at the moment.

Was there reason for this? I'm happy to contribute.

@completenovice
Copy link
Contributor

@M-Whitaker I am not affiliated with FusionAuth but might be able to help.

From the API Reference you shared, I see applications[x].oauthConfiguration.clientId, application.oauthConfiguration.clientId, and oauthConfiguration.clientId all exist as part of the Response only. I can't see it anywhere in the Request data.

That being said, I believe there is a bug in the provider, just not in the way you are describing it. I think the bug lies in the oauth_configuration block, whereby it accepts the client_id attribute but the FusionAuth Provider can never set the value through the API, resulting in a perma-diff:

The following example configuration will set the fusionauth_application.oauth_configuration[0].client_id from the autogenerated value to complete-novice, applies 'successfully', but then computes the same diff over and over:

data "fusionauth_tenant" "default"{
    name = "Default"
}

resource "fusionauth_application" "example" {
  name      = "example"
  tenant_id = data.fusionauth_tenant.default.id

  oauth_configuration {
    client_id = "complete-novice"
  }
}

@M-Whitaker
Copy link
Author

M-Whitaker commented May 19, 2023

Ah, I now see where I went wrong. Ctrl F not working in my favour. Thanks for pointing this out and also the reference to the bug in the terraform provider that allows this and doesn't call it out as a validation error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants