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.