Authing DocsDocuments
Concept
Guides
Development Integration
Application integration
Concept
Guides
Development Integration
Application integration
Old Version
Development Integration
  • Single Sign-On (SSO)
  • Login component

  • JavaScript/Node.js

    • User Authentication Module

    • Management Module

      • Management user
      • Management application
      • Management role
      • Manage resources and permissions
      • Management groups
      • Management organization
      • Management User Custom Fields
      • Management registration white list
      • Management user pool configuration
      • Management MFA
      • Management subject certification
  • Java / Kotlin

  • Python

  • C#

  • PHP

  • Go

  • Ruby
  • Android

  • iOS

  • Flutter

  • React Native
  • WeChat Mini Program
  • WeChat webpage authorization
  • Framework Integration
  • Error code
  1. Development Integration
  2. /
  3. JavaScript/Node.js
  4. /
  5. Management Module
  6. /
  7. Management User Custom Fields

¶ UdfManagementClient

Update Time: 2022-05-14 09:29:46
Edit

Udf is short for User Defined Field. Authing data entities (such as users, roles, groups, organizations, etc.) can add user defined fields which Authing does not built-in. For example, if you need to create a school-related application, you can add a user defined field: school field.

You can ask the user to supplement the information in this field after the user registration is completed, click here to check the details.

Please follow the instructions below to use this client:

import { ManagementClient } from "authing-js-sdk";
const managementClient = new ManagementClient({
  userPoolId: "YOUR_USERPOOL_ID",
  secret: "YOUR_USERPOOL_SECRET"
});
managementClient.udf.list; // get user defined field metadata list
managementClient.udf.set; // set user defined data
managementClient.udf.remove; // delete user defined data

¶ Set user defined field metadata

UdfManagementClient().set(targetType, key, dataType, label)

Set user defined field metadata. If the field does not exist, it will be created automatically.

¶ Parameter

  • targetType <UdfTargetType> user defined field target type.
  • key <string> field key
  • dataType <UdfDataType> data type. Authing currently supports five data types: string, number, datetime, boolean and object.
  • label <string> Field Label, which commonly is a Human Readable string.

¶ Example

import { ManagementClient, UdfTargetType, UdfDataType } from "authing-js-sdk";
const udf = await managementClient.udf.set(
  UdfTargetType.User,
  "school",
  UdfDataType.String,
  "school"
);
// if user defined field "age" does not exist, it will create it automatically

import { ManagementClient, UdfTargetType, UdfDataType } from "authing-js-sdk";
const udf = await managementClient.udf.set(
  UdfTargetType.User,
  "age",
  UdfDataType.Number,
  "age"
);

// if field "age" is created before, it will update its configuration

const udf = await managementClient.udf.set(
  UdfTargetType.User,
  "age",
  UdfDataType.Number,
  "new description"
);

¶ Return value

  • Promise<UserDefinedField[]>

¶ Delete a user defined field

UdfManagementClient().remove(targetType, key)

Delete a user defined field.

¶ Parameter

  • targetType <UdfTargetType> user defined field target type. Use USER to represent user and ROLE to represent reole.
  • key <string> field key

¶ Example

await managementClient.udf.remove(UdfTargetType.User, "school");

¶ Return value

  • Promise<UserDefinedField[]>

¶ Get the user defined field

UdfManagementClient().list(targetType)

Get the user defined field defined by the user pool.

¶ Parameter

  • targetType <UdfTargetType> user defined field target type. Use USER to represent user and ROLE to represent reole.

¶ Example

const list = await managementClient.udf.list(UdfTargetType.User);

¶ Return value

  • Promise<UserDefinedField[]>
Prev: Management organization Next: Management registration white list
  • Set user defined field metadata
  • Delete a user defined field
  • Get the user defined field

User identity management

Integrated third-party login
Mobile phone number flash check (opens new window)
Universal login form component
Custom authentication process

Enterprise internal management

Single Sign On
Multi-factor Authentication
Authority Management

Developers

Development Document
Framework Integration
Blog (opens new window)
GitHub (opens new window)
Community User Center (opens new window)

Company

400 888 2106
sales@authing.cn
16 / F, Block B, NORTH STAR CENTURY CENTER, Beijing(Total)
room 406, 4th floor, zone B, building 1, No. 200, Tianfu Fifth Street, Chengdu(branch)

Beijing ICP No.19051205-1

© Beijing Steamory Technology Co.