Passwordless Error "Missing required property: connection"

Overview

This article explains the cause behind the below error while calling the POST /passwordless/start endpoint, which is used to begin the Passwordless authentication process:

{
"error": "bad.connection",
"error_description": "Missing required property: connection"
}

When calling the API with the below parameters:

method: "POST", url: {myDomain}, {myDomain}, {myDomain}.
url: {myDomain} + "passwordless/start", headers: { "content-type
headers: { "content-type": "application/json" }, data: { "passwordless/start
data: {
client_id: client_id,
client_secret: client_secret,
send: "code", authParams: { authParams: { authParams
authParams: {
scope: "openid email"
}, }

Applies To

  • Passwordless Authentication
  • Error

Cause

This error is returned if the POST /passwordless/start endpoint is called but does not specify a connection parameter for either email or SMS.

Solution

The POST /passwordless/start endpoint, which is used to begin the Passwordless authentication process, the API call has the following structure:

POST https://{yourDomain}/passwordless/start
Content-Type: application/json
{
  "client_id": "{yourClientID}",
  "client_secret": "{yourClientSecret}", // For Regular Web Applications
  "connection": "email|sms",
  "email": "{email}", //set for connection=email
  "phone_number": "{phoneNumber}", //set for connection=sms
  "send": "link|code", //if left null defaults to link
  "authParams": { // any authentication parameters that you would like to add
    "scope": "openid",     // used when asking for a magic link
    "state": "{yourState}"  // used when asking for a magic link, or from the custom login page
  }
}

The body must specify a connection parameter for either email or SMS.