auth0 / terraform-provider-auth0

The Auth0 Terraform Provider is the official plugin for managing Auth0 tenant configuration through the Terraform tool.
https://registry.terraform.io/providers/auth0/auth0/latest/docs
Mozilla Public License 2.0
157 stars 73 forks source link

totp is always applied #935

Closed njlr closed 1 month ago

njlr commented 3 months ago

Checklist

Description

Here is my resource:

resource "auth0_connection" "app" {
  name                 = "App"
  is_domain_connection = true
  strategy             = "auth0"

  options {
    disable_signup   = true
    api_enable_users = false

    brute_force_protection = true

    password_policy = "fair"

    password_history {
      enable = true
      size   = 3
    }

    password_complexity_options {
      min_length = 12
    }

    totp {
      time_step = 300
      length    = 6
    }

    mfa {
      active                 = true
      return_enroll_settings = true
    }
  }
}

When I apply this, I get this change:

 ~ resource "auth0_connection" "app" {
        id                   = "con_xxxxxxxx"
        name                 = "App"
        # (4 unchanged attributes hidden)

      ~ options {
            # (30 unchanged attributes hidden)

          + totp {
              + length    = 6
              + time_step = 300
            }

            # (3 unchanged blocks hidden)
        }
    }

When I apply it for a second time, the change is the same!

Expectation

It should apply once and then require no more changes (or throw an error)

Reproduction

(see above)

Auth0 Terraform Provider version

1.2.0

Terraform version

1.7.5

developerkunal commented 1 month ago

Hey @njlr,

Hope you're doing well!

It seems that totp is not recognized as an attribute in the Terraform Auth0 provider for the Auth0 strategy for connection resources. This might be the reason why it's not updating as expected.

developerkunal commented 1 month ago

Hi @njlr,

I hope you're doing well!

I will be closing this issue. If you encounter any other issues, please open a new issue.

njlr commented 1 month ago

It seems that totp is not recognized as an attribute in the Terraform Auth0 provider for the Auth0 strategy for connection resources. This might be the reason why it's not updating as expected.

Is this intended behavior? It seems like a bug to me.

developerkunal commented 1 month ago

Hi @njlr,

There's a bug in the system that's allowing the inclusion of the "totp" attribute. This attribute shouldn't be allowed because it's not part of the Auth0 strategy. Currently, "totp" is being accepted for all strategies, but we're going to update it to only apply to passwordless email and SMS support.

developerkunal commented 1 month ago

Hi @njlr ,

I hope you're having a pleasant day!

I just wanted to inform you that I'll be closing this issue shortly. However, if you have any more issues or questions, please feel free to open a new one. I'm here to assist you further.

Thank you for your cooperation.

Best regards,