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
166 stars 82 forks source link

Can't trigger passwordless to turn on #1040

Open joemacrovesta opened 3 weeks ago

joemacrovesta commented 3 weeks ago

image

Description

I am attempting to enable the passwordless email connection in Auth0 using Terraform, but the connection does not activate in the dashboard (as shown in the attached screenshot). Even though the connection is correctly linked to my application via auth0_connection_client, the email passwordless toggle remains off, and the connection does not get enabled.

Terraform Configuration: Below is the relevant Terraform code I’m using:

resource "auth0_connection" "passwordless_email" {
  strategy = "email"
  name     = "email"
  options {
    from                   = var.email_template_from_string
    subject                = var.email_template_subject_string
    syntax                 = "liquid"
    template               = var.email_template_body_string
    disable_signup         = false
    brute_force_protection = true
    non_persistent_attrs   = []
    auth_params = {
      scope         = "openid email profile offline_access"
      response_type = "code"
    }

    totp {
      time_step = 300
      length    = 6
    }
  }
}

resource "auth0_connection_client" "passwordless_email_client" {
  connection_id = auth0_connection.passwordless_email.id
  client_id     = auth0_client.my_app.client_id
}

The Problem: The connection is successfully created, and the client linkage works, but the Passwordless Email toggle in the Auth0 dashboard (as seen in the attached screenshot) remains off. I attempted to use enabled = true in the auth0_connection resource, but it appears that this is not a valid option for the resource. As a result, I cannot activate the passwordless email connection, and it doesn't use the custom email template as expected. Expected Behavior: The passwordless email connection should be enabled and available for users to log in, and it should use the custom email template I’ve provided in the Terraform configuration. Attached: Screenshot showing the passwordless email toggle remaining off despite the connection being created. Can you help me identify how to properly enable the passwordless email connection via Terraform?

Expectation

to toggle on passwordless and enble my application for it

Reproduction

read code

Auth0 Terraform Provider version

hashicorp

Terraform version

  source  = "auth0/auth0"       version = "~> 1.3.0"     }
duedares-rvj commented 1 week ago

@joemacrovesta Hello. Hope you're doing well. I tried to reproduce this issue on my end, but it worked as expected.

Here's my steps:

  1. Check Dashboard that email and password toggle both are disabled.
  2. Created a simple M2M application. (got the client_id from here)
  3. Created a fresh strategy = "email" connection. (got the connection_id from here)
  4. Associated them using auth0_connection_client by passing connection_id and client_id
  5. Checked dashboard again and could see email toggle green -> enabled.

Let me know if you'd like to setup some time. Feel free to provide any additional information that can help me reproduce this.

Thanks!

duedares-rvj commented 8 hours ago

@joemacrovesta Circling back on this if you had a chance to try this out.