What dose it mean "connection is required"? I wanna use custom login form

Hello.
I’m a Japanese, so my English is maybe so bad.Sorry.


I want to use custom login or sign up form only MAILADDRESS and PASSWORD.
I found this page : https://auth0.com/docs/libraries/custom-signup .

So I created a form to enter my email address and password and sent information from PHP to Auth 0.

$curl = curl_init();

            $data = [
                'client_id' => 'xxxxxxxxxxxxxxx',
                'email' => 'my email address',
                'password' => 'PassWord1234'
            ];

            $json = json_encode($data);

            curl_setopt_array($curl, array(
                CURLOPT_URL => "https://xxxxxxxxxxxxxxxx/dbconnections/signup",
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_ENCODING => "",
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 30,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => "POST",
                CURLOPT_POSTFIELDS => $json,
                CURLOPT_HTTPHEADER => array(
                    "content-type: application/json"
                ),
            ));

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
                echo "cURL Error #:" . $err;
            } else {
                echo $response;
            }

However, Auth0 returned the message {"error":"connection is required"}.

I did not know exactly what was wrong, I also tried CURL.

  curl --request POST \
--url 'https://xxxxx/dbconnections/signup' \
--header 'content-type: application/json' \
--data '{"client_id": "xxxxxxxxxxxxx","email": "my email address","password": "PasssWord1234","user_metadata": {"name": "john","color": "red"}}'

Auth0 returned the same message connection is required.

What should I do?
If someone knows how to solve it, I’d appreciate it if you could teach me.

Thank you.


Snake feet.

I use CakePHP3.

do you have two or more database connections available?

Thank you for your reply!

do you have two or more database connections available?

No…
I have only one tenant and only one DB.

Here’s the correct link
https://auth0.com/docs/api/authentication#signup

1 Like

As @arts link suggests you need to put the name of your database connection as part of this. I believe the connection parameter is required even if you have a single connection.

We just updated our docs with the missing required parameter: add missing param · auth0/docs@147802e · GitHub

2 Likes

@arts @luis.rudge @sgmeyer
Everyone, thank you for your reply!
I have solved this problem.

I included connection => DATABASE NAME, It could connect!
Thank you!

2 Likes