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

          • Get Group Details
          • Get Group List
          • Create Group
          • Batch Create Groups
          • Modify Group
          • Batch Delete Groups
          • Add Group Members
          • Batch Remove Group Members
          • Get Group Member List
          • Get Group Authorized Resource List
        • 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. Group Management

  10. /
  11. Get Group Member List

¶ 获取分组成员列表

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

通过分组 code,获取分组成员列表,支持分页,可以获取自定义数据、identities、部门 ID 列表。

¶ 请求参数

名称类型必填默认值描述示例值
codestring是-分组 code。developer
pagenumber否1当前页数,从 1 开始。1
limitnumber否10每页数目,最大不能超过 50,默认为 10。10
withCustomDataboolean否-是否获取自定义数据。true
withIdentitiesboolean否-是否获取 identities。true
withDepartmentIdsboolean否-是否获取部门 ID 列表。true

¶ 示例代码

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.listGroupMembers({
    code: "developer",

    page: 1,

    limit: 10,

    withCustomData: true,

    withIdentities: true,

    withDepartmentIds: true,
  });
})();

¶ 请求响应

类型: UserPaginatedRespDto

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

示例结果:

{
  "statusCode": 200,
  "message": "操作成功",
  "apiCode": 20001,
  "data": {
    "list": {
      "userId": "6229ffaxxxxxxxxcade3e3d9",
      "createdAt": "2022-07-03T02:20:30.000Z",
      "updatedAt": "2022-07-03T02:20:30.000Z",
      "status": "Activated",
      "email": "test@example.com",
      "phone": "188xxxx8888",
      "phoneCountryCode": "+86",
      "username": "bob",
      "name": "张三",
      "nickname": "张三",
      "photo": "https://files.authing.co/authing-console/default-user-avatar.png",
      "loginsCount": 3,
      "lastLogin": "2022-07-03T02:20:30.000Z",
      "lastIp": "127.0.0.1",
      "gender": "M",
      "emailVerified": true,
      "phoneVerified": true,
      "passwordLastSetAt": "2022-07-03T02:20:30.000Z",
      "birthdate": "2022-06-03",
      "country": "CN",
      "province": "BJ",
      "city": "BJ",
      "address": "北京朝阳",
      "streetAddress": "北京朝阳区 xxx 街道",
      "postalCode": "438100",
      "externalId": "10010",
      "departmentIds": "[\"624d930c3xxxx5c08dd4986e\",\"624d93102xxxx012f33cd2fe\"]",
      "identities": {
        "identityId": "62299d8b866d2dab79a89dc4",
        "extIdpId": "6076bacxxxxxxxxd80d993b5",
        "provider": "wechat",
        "type": "openid",
        "userIdInIdp": "oj7Nq05R-RRaqak0_YlMLnnIwsvg",
        "originConnIds": "[\"605492ac41xxxxe0362f0707\"]"
      },
      "customData": {
        "school": "北京大学",
        "age": 22
      },
      "statusChangedAt": "2022-07-03T02:20:30.000Z"
    }
  }
}

¶ 数据结构

¶ UserPagingDto

名称类型必填描述
totalCountnumber是记录总数。
listarray是数据列表。嵌套类型:UserDto。

¶ UserDto

名称类型必填描述
userIdstring是用户 ID。 示例值: 6229ffaxxxxxxxxcade3e3d9
createdAtstring是账号创建时间。 示例值: 2022-07-03T02:20:30.000Z
updatedAtstring是账号更新时间。 示例值: 2022-07-03T02:20:30.000Z
statusstring是账户当前状态。 枚举值:Suspended,Resigned,Activated,Archived
emailstring否邮箱。 示例值: test@example.com
phonestring否手机号。 示例值: 188xxxx8888
phoneCountryCodestring否手机区号。 示例值: +86
usernamestring否用户名,用户池内唯一。 示例值: bob
namestring否用户真实名称,不具备唯一性。 示例值: 张三
nicknamestring否昵称。 示例值: 张三
photostring否头像链接。 示例值: https://files.authing.co/authing-console/default-user-avatar.png
loginsCountnumber否历史总登录次数。 示例值: 3
lastLoginstring否上次登录时间。 示例值: 2022-07-03T02:20:30.000Z
lastIpstring否上次登录 IP。 示例值: 127.0.0.1
genderstring是性别。 枚举值:M,W,U
emailVerifiedboolean是邮箱是否验证。 示例值: true
phoneVerifiedboolean是手机号是否验证。 示例值: true
passwordLastSetAtstring否用户上次密码修改时间。 示例值: 2022-07-03T02:20:30.000Z
birthdatestring否出生日期。 示例值: 2022-06-03
countrystring否所在国家。 示例值: CN
provincestring否所在省份。 示例值: BJ
citystring否所在城市。 示例值: BJ
addressstring否所处地址。 示例值: 北京朝阳
streetAddressstring否所处街道地址。 示例值: 北京朝阳区 xxx 街道
postalCodestring否邮政编码号。 示例值: 438100
externalIdstring否第三方外部 ID。 示例值: 10010
resetPasswordOnNextLoginboolean否下次登录要求重置密码。
departmentIdsarray否用户所属部门 ID 列表。 示例值: ["624d930c3xxxx5c08dd4986e","624d93102xxxx012f33cd2fe"]
identitiesarray否外部身份源。嵌套类型:IdentityDto。
customDataobject否用户的扩展字段数据。 示例值: [object Object]
statusChangedAtstring否用户状态上次修改时间。 示例值: 2022-07-03T02:20:30.000Z

¶ IdentityDto

名称类型必填描述
identityIdstring是Identity ID。 示例值: 62299d8b866d2dab79a89dc4
extIdpIdstring是外部身份源的 ID。 示例值: 6076bacxxxxxxxxd80d993b5
providerstring是外部身份源类型,如 lark, wechat。 示例值: wechat
typestring是Identity 类型,如 unionid, openid, primary。 示例值: openid
userIdInIdpstring是在外部身份源的 id。 示例值: oj7Nq05R-RRaqak0_YlMLnnIwsvg
originConnIdsarray是身份来自的身份源连接 ID 列表。 示例值: ["605492ac41xxxxe0362f0707"]
Previous article: Batch Remove Group Members Next article: Get Group Authorized Resource List
  • 请求参数
  • 示例代码
  • 请求响应
  • 数据结构

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.