The multiIdentifierAuth Field


The multiIdentifierAuth field enables you to associate a single field with multiple schema attributes. This is typically done for authentication purposes: for example, a form might give users the option of authenticating by using either their email address or their mobile device number. In that case, the multiIdentifierAuth field would reference both the email and the mobileNumber user profile attributes.


multiIdentifierAuth Attributes and Terminology

The multiIdentifierAuth field (like other Identity Cloud fields) provides a number of attributes you can use when creating and formatting the field. Also like other Identity Cloud fields, the terminology used to represent these attributes when using the Configuration APIs sometimes differs from the terminology used if you view the underlying flow. 

Needless to say, that can be confusing at times. With that in mind, the following table shows the different multiIdentifierAuth attributes and how they are referenced in the Configuration AP, and the flow; click the appropriate link in the flow column for more information about that attribute. Attributes highlighted in orange are auto-generated when the field is created, and shouldn’t be referenced when making an API call.

Note that you can’t create a multiIdentifierAuth field in the Console’s Registration Builder.

Option used in Registration Builder

Parameter used when making an API call

Property name used in the flow


name

name


type

type


schemaAttributes

schemaId


label

label


placeholder

placeholder


forms

forms



element


Creating a multiIdentifierAuth Field by Using the Configuration API

When using the Configuration APIs to create a multiIdentifierAuth field, you must include all the desired attributes and attribute values within the body parameter of your API call. That body parameter will look similar to the one shown below (depending, of course, on the number of attributes you use). In the following example, required attributes are shown in red:

{
    "type": "multiIdentifierAuth",
    "forms": [
        "traditionalRegistrationForm"
        ],
    "label": {
        "key": "3d43b06fe00fa7cdc32e45ecc8399239"
        },
       "placeholder": {
        "key": "3d43b06fe00fa7cdc32e45ecc8399239"
        },
  "schemaAttributes": [
        "email",
        "mobileNumber"
    ],
    "name": "testFieldMultiIdentifier"
}

If you’re using Postman, your body parameter will look like this:

There are at least three things to keep in mind when creating the body parameter:

  • The parameter must be formatted using JSON (JavaScript Object Notation). If you get the following error, that often means that your body parameter isn’t using valid JSON:
    400 Bad Request. The browser (or proxy) sent a request that this server could not understand.
  • The schemaAttributes parameter must be formatted as a JSON array, and must contain at least two attributes. In addition, each attribute  must have the string datatype and must be configured as globally-unique. If either (or both) attributes fail this test, your API call will likewise fail:
    [None] is not a valid schemaAttributes. All listed attributes should be type of `string` and must have the `unique` constraint at the schema level: ['mobileNumber', '[profiles].identifier', 'email']
  • The forms parameter must be formatted as a JSON array, with the form names configured as a comma-separated list between square brackets. For example,
    "forms": ["traditionalRegistrationForm", "socialRegistrationForm"]

A complete Curl command for creating a multiIdentifierAuth field will look similar to this:

curl -L -X POST \
  'https://v1.api.us.janrain.com/config/79y4mqf2rt3bxs378kw5479xdu/flows/fieldExamples/fields' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Basic eTR4Zmc2ZjQ0bXNhYzN2ZXBqanZ4Z2d6dnQzZTNzazk6OTVjY3hrN2N6YnZ1eng2ZHB0ZTVrOXA2ZGo1Ynpla3U=' \
  --data-raw '{
    "type": "multiIdentifierAuth",
    "forms": [
        "traditionalRegistrationForm"
        ],
    "label": {
        "key": "3d43b06fe00fa7cdc32e45ecc8399239"
        },
       "placeholder": {
        "key": "3d43b06fe00fa7cdc32e45ecc8399239"
        },
    "schemaAttributes": [
        "email",
        "mobileNumber"
      ],
    "name": "testFieldMultiIdentifier"
}'