GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
  • Single Page Web Application

  • Mobile and Client Applications

  • Standard Web Application

    • Java

    • Node.js

      • Installation and Usage
      • User Authentication Module
      • Management Module

        • User Management

        • Group Management

        • Role Management

        • Organization Management

        • 访问控制管理

        • 外部身份源管理

        • 自定义字段管理

          • 获取用户池配置的自定义字段列表
          • 创建/修改自定义字段定义
          • 设置自定义字段的值
          • 获取用户、分组、角色、组织机构的自定义字段值
    • Python

  • Framework Integration

  • Others

  1. Development Integration
  2. /
  3. Standard Web Application
  4. /
  5. Node.js
  6. /
  7. Management Module

  8. /
  9. 自定义字段管理

  10. /
  11. 获取用户、分组、角色、组织机构的自定义字段值

¶ 获取用户、分组、角色、组织机构的自定义字段值

Update time: 2025-07-23 07:34:21
Edit

通过筛选条件,获取用户、分组、角色、组织机构的自定义字段值。

¶ 请求参数

名称类型必填默认值描述示例值
targetTypestring是-主体类型,目前支持用户、角色、分组、部门。 枚举值:USER,ROLE,GROUP,DEPARTMENTUSER
targetIdentifierstring是-目标对象唯一标志符。userId1
namespacestring否-所属权限分组的 code,当 targetType 为角色的时候需要填写,否则可以忽略。default

¶ 示例代码

import { ManagementClient } from "@genauth/nodejs";
// 在 Node.js 中引用:
// const { ManagementClient } = require('@genauth/nodejs');

const managementClient = new ManagementClient({
  accessKeyId: "GEN_AUTH_USERPOOL_ID",
  accessKeySecret: "GEN_AUTH_USERPOOL_SECRET",
});

(async () => {
  const result = await managementClient.getCustomData({
    targetType: "USER",

    targetIdentifier: "userId1",

    namespace: "default",
  });
})();

¶ 请求响应

类型: GetCustomDataRespDto

名称类型描述
statusCodenumber业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。
messagestring描述信息
apiCodenumber细分错误码,可通过此错误码得到具体的错误类型。
dataobject具体的自定义数据值

示例结果:

{
  "statusCode": 200,
  "message": "操作成功",
  "apiCode": 20001,
  "data": {
    "age": 18,
    "school": "pku"
  }
}

¶ 数据结构

Previous article: 设置自定义字段的值 Next article: Python
  • 请求参数
  • 示例代码
  • 请求响应
  • 数据结构

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.