How-tos

2 mins read

Define User Attributes

Create identity schemas and define the attributes that describe the user entity to fulfill all the requirements of your organization. Provide a schema both for user (payload) attributes (editable by the user and administrators) and the metadata attributes (read-only for users, editable by administrators).

Create Identity Schemas

  1. Go to Tenant settings > Identity Pools > Schemas.

  2. Select Create Schema and save your schema under a unique name.

  3. Open your schema and go to the Schema tab. This is where you define the schema as a JSON object. Initially, the default schema is shown. Take note of the top-level objects:

    Object Description
    properties An array of objects where each object represents a property to be entered by the user
    description Schema description for identification purposes. This description is displayed as a header on the user registration form.
    type Schema data type - there should be no need to change this as the schema will always be an object.
    required List of mandatory properties for user registration

    Modify the schema by adding more properties. Add mandatory properties to the required list. For example, to add an e-mail and custom properties, you can make the following modifications:

    {
    "properties":{
        "family_name":{
            "description":"user last name",
            "type":"string",
            "minLength":1
        },
        "given_name":{
            "description":"user first name",
            "type":"string",
            "minLength":1
        },
        "name":{
            "description":"user full name",
            "type":"string",
            "minLength":1
        },
        "e-mail":{
            "description":"user e-mail",
            "type":"string",
            "minLength":1
        },
        "custom":{
            "description":"Custom",
            "type":"boolean",
            "minLength":1
        }
    },
    "description":"sample user data schema",
    "type":"object",
    "required":[
        "family_name",
        "given_name",
        "e-mail",
        "custom"
    ]
    }
    

    As a result, the required user payload (both on administrator and user side) looks as follows:

    Identity Schema for users

  4. Save your schema to apply your changes.

    Result

    Your schema is created. You can now assign it to an Identity Pool either as a user schema or metadata schema.

Assign Schema

  1. Navigate to the identity pool you wish to be configured with the new schema and select Schemas.

  2. Set the schema either as a User Schema or Metadata Schema using dropdowns and save your changes.

Updated: Jun 20, 2023