Auth0 Home Blog Docs

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

auth0
api
login

#1

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.


#2

do you have two or more database connections available?


#3

Thank you for your reply!

do you have two or more database connections available?

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


#5

Here’s the correct link


#6

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.


#7

We just updated our docs with the missing required parameter: https://github.com/auth0/docs/commit/147802e66f33a0e7f33731aea25419fc265701d5


#8

@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!


How to login with API (PHP)