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 81 forks source link

Manage MFA Factors #124

Closed rpf3 closed 2 years ago

rpf3 commented 2 years ago

Is there a way to manage the enabled MFA factors as outlined here? The only thing I can find that deals with MFA is the guardian resource.

sergiught commented 2 years ago

Hey @rpf3 👋🏻 , you can indeed use the guardian resource for this.

Docs: https://registry.terraform.io/providers/auth0/auth0/latest/docs/resources/guardian

Some examples that could help your use case:

resource "auth0_guardian" "twilio_example" {
  policy = "all-applications"
  phone {
    provider = "twilio"
    message_types = ["sms"]
    options {
        enrollment_message = "enroll foo"
        verification_message = "verify foo"
        from = "from bar"
        messaging_service_sid = "foo"
        auth_token = "bar"
        sid = "foo"
    }
  }
}

resource "auth0_guardian" "default" {
  policy = "all-applications"
  phone {
    provider      = "auth0"
    message_types = ["sms"]
    options {
      enrollment_message   = "{{code}} is your verification code for {{tenant.friendly_name}}. Please enter this code to verify your enrollment."
      verification_message = "{{code}} is your verification code for {{tenant.friendly_name}}."
    }
  }
  email = true
  otp = true
}

Does this help?

rpf3 commented 2 years ago

Thank you, yes. Not sure how I overlooked the otp argument. What about DUO integration?

sergiught commented 2 years ago

Happy to help @rpf3

Sadly DUO is not yet supported within the provider as of right now. 😞 If that's something you require, would you mind opening a specific issue for it so we can track it?

I can't unfortunately let you know when we'll be able to introduce that as we're trying to push through a massive backlog right now, but contributions are more than welcome.

rpf3 commented 2 years ago

Will do, thanks for the info/help