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 | Member used when making an API call | Property name used in the flow |
---|---|---|
name | name | |
type | type | |
schemaAttribute | 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 request body of your API call. That request body will look similar to the one shown below (depending, of course, on the number of attributes you use).:
{
"type": "multiIdentifierAuth",
"forms": [
"traditionalRegistrationForm"
],
"label": {
"key": "3d43b06fe00fa7cdc32e45ecc8399239"
},
"placeholder": {
"key": "3d43b06fe00fa7cdc32e45ecc8399239"
},
"schemaAttributes": [
"email",
"mobileNumber"
],
"name": "testFieldMultiIdentifier"
}
If you’re using Postman, your request body will look like this:
There are at least three things to keep in mind when creating the request body:
- The request body must be formatted using JSON (JavaScript Object Notation). If you get the following error, that often means that your request body isn’t using valid JSON:
400 Bad Request. The browser (or proxy) sent a request that this server could not understand.
- The schemaAttributes member 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 member 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"
}'
Updated about 2 years ago