Connection not found when using Auth0 signup API

223 Views Asked by At

I'm trying to create a user in Auth0 with sign up API.
Take a look at the code:

    @receiver(post_save, sender=ExampleModel)
    def tenant_is_created(sender, instance, created, **kwargs):
        if created:
            password = ''.join(random.choices(string.ascii_uppercase + string.digits, k=15))
            url = "https://my-domain-name.eu.auth0.com/dbconnections/signup"
            user_data = {
                'client_id': config("APP_CLIENT_ID"),
                'full_name': instance.full_name,
                'first_name': instance.first_name,
                'last_name': instance.last_name,
                'email': instance.email,
                'password': password,     
                'cell': instance.cell,
                'connection': config("DATABASE_CONNECTION"),
            }
            requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
            r = requests.post(url, json = user_data, verify=False)
            print(r.text)
            if r.status_code == 404:
                print("Connection error")

I put the identifier under db as connection value.

I'm using the default application credentials. Also tried with creat other db connections and I still get {"error":"connection not found"}.

1

There are 1 best solutions below

0
Mike D Hovhannisyan On

Connection field needs to be name of the database and not the identifier.