Disable Username-Password-Authentication for an Auth0 application

Hi all,

I am using latest auth0 terraform to configure our application domain. our usecase to create custom database and associate that database to a Web application.
I could achieve this using “auth0-client”, “auth0-connections” , “auth0-connection-client” .

however i could not disable default “Username-Password-Authentication” database asscoiated to that Webapp. any idea how to disable that using Terraform. Please help.

thanks
ssj

Hi @sadhasivam :wave:

Welcome to the Community!

To be able to toggle off the pre-generated (and default) Username-Password-Authentication connection you will need to import the resource into Terraform as described in the following link.

After doing this, you will be able to manage this connection through your Terraform configuration.

Let me know if you have any trouble with this!

1 Like

Thanks. i tried importing. i am not sure how i can disconnect the “Username-Password-Authentication” database that is automatically tied to the terraform created new apps.

Steps.i followed

  1. Get the Tenant ClientID , ClientSecret. Domain
  2. Creater Terraform managed machine to machine app
  3. Use terraform to create an App (singlePage)
  4. Create Custom database
  5. Use Grants to enable custom database to new App

Expected out:
New App connected with one custom user Database

What happened
I see two databases connected to the app.

  1. Custom user database created via terraform
  2. Successfully gave grants to newly created custom database from the App.
  3. Default Username-Password-Authetnication database created

I am not sure how to de-activate the connection between app & default DB via terraform. Importing the resource to terraform don’t have any flag to disable or something.

thoughts?

Hi @sadhasivam

Thanks for confirming that!

It sounds like the Tenant flag enable_client_connections is enabled, which will result in all current connections being enabled on newly created Applications by default. There are two different ways you can toggle this off.

  1. Through your Terraform configuration via the auth0_tenant resource. E.g.
resource "auth0_tenant" "main_tenant" {
  friendly_name = "My Tenant"
  support_email = "support@example.com"

  flags {
    enable_client_connections = false
  }
}
  1. Through your Auth0 Tenant Dashboard: Navigate Settings -> Advanced and then scroll down until you see Enable Application Connections and toggle the button off.

After disabling this setting, your newly created Applications will no longer have all the connections enabled by default, and instead you will be able to assign the connections in Terraform through the auth0_connection_client resource.

Let me know how you get on!

2 Likes

Thanks a lot @james.merrigan your advice worked out. appreciate your help.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.