Hi,
I’m trying to use Passwordless Authentication with Magic Links on a regular web application.
First I tried to use curl to send an email with a code:
curl --request POST --url ‘https://dev-4tddokfo.eu.auth0.com/passwordless/start’ --header ‘content-type: application/json’ --data ‘{“client_id”: “4PYhqSCQ1AFefPomYTj6Cec7pwkYV7g0”, “client_secret”: “MY_CLIENT_SECRET”, “connection”: “email”, “email”: “thibaud.godard@ysance.com”,“send”: “code”}’
I receive an email with a code and I can put this code in my login page to log in my app. It’s work. So I think my app is well configured.
Then I tried to add a form in my “admin page” (and stop to use curl), to send an email to somebody to invite him with a LINK.
Python server:
conn = http.client.HTTPSConnection(“dev-4tddokfo.eu.auth0.com”)
payload = “{"client_id": "4PYhqSCQ1AFefPomYTj6Cec7pwkYV7g0", "client_secret": "MY_SECRET", "connection": "email", "email": "{EMAIL}","send": "link"}”.format(EMAIL=email)
headers = {‘content-type’: “application/json”}
conn.request(“POST”, “/dev-4tddokfo.eu.auth0.com/passwordless/start”, payload, headers)
res = conn.getresponse()
data = res.read()
When I do that, I don’t receive any email and I have this error when I print data: {“error”:“bad.tenant”,“error_description”:“error in tenant - tenant validation failed: dev-4tddokfo.eu.auth0.com”}
I followed this documentation:
I don’t understand why?
I also tried to use curl like this:
curl --request POST --url ‘https://dev-4tddokfo.eu.auth0.com/passwordless/start’ --header ‘content-type: application/json’ --data ‘{“client_id”: “4PYhqSCQ1AFefPomYTj6Cec7pwkYV7g0”, “client_secret”: “MY_CLIENT_SECRET”, “connection”: “email”, “email”: “thibaud.godard@ysance.com”,“send”: “code”}’
I received email but when I click on the link, I have this error:
{
- message: “400 Bad Request: The browser (or proxy) sent a request that this server could not understand. KeyError: ‘code’”
}
Thanks !