Authing DocsDocuments
Concept
workflow
Guides
Development Integration
Application integration
Concept
workflow
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 subject certification

¶ Management certification body

Update Time: 2025-05-14 08:32:28
Edit

This module is used to conduct body authentication, such as personal authentication or corporate certification.

Sample code:

import { ManagementClient } from 'authing-js-sdk'
const managementClient = new AuthenticationClient({
  userPoolId: 'YOUR_USERPOOL_ID',
  secret: 'YOUR_USERPOOL_SECRET',
})

authenticationClient.principal.detail
authenticationClient.principal.authenticate

¶ Get a certification details

PrincipalManagementClient().detail(userId)

Get the main authentication details

¶ parameter

  • userId <string>, user ID

¶ Example

const managementClient = new ManagementClient({
  userPoolId: 'YOUR_USERPOOL_ID',
  secret: 'YOUR_USERPOOL_SECRET',
})

const principalInfo = await managementClient.principal.detail('60b4a136d9xxxxcc3d87e55a')

¶ return value

  • Promise<PrincipalDetail | null>, Return when not authenticated null

¶ Sample data

{
  "id": "60b4d72f56b49fb97281001b",
  "createdAt": "2021-05-31T12:31:43.416Z",
  "updatedAt": "2021-05-31T12:31:43.416Z",
  "userPoolId": "607fe30c14d1650eb1d888ca",
  "userId": "60a336dc179abb512dd64ae7",
  "principalType": "P", // "P" represents personal authentication, "e" represents personal authentication
  "principalName": "xxx",
  "principalCode": "xxxxxxxxxxxxxxx",
  "authenticationTime": "2021-05-31T12:31:43.414Z"
}

¶ 进行主体认证

PrincipalAuthentication().authenticate(userId, principalInfo)

Subject authentication

¶ parameter

The parameters that are incorporated when performing personal authentication and corporate certification, as follows.

¶ Personal authentication
  • userId: <string> user ID
  • principalInfo: <object>
    • principalInfo.type: <string> Personal certification should be passed to the fixed string "P"
    • principalInfo.name: <string> Personal name
    • principalInfo.idCard: <string> Personal ID number
    • principalInfo.bankCard: <string> Personal bank card number
¶ Enterprise Certification
  • principalInfo: <object>
    • principalInfo.type: <string>Companies should pass authentication fixed string "E"
    • principalInfo.enterpriseName: <string> Company Name
    • principalInfo.enterpriseCode: <string> Enterprise unified social credit code
    • principalInfo.legalPersonName: <string> Corporate legal name

¶ Example

const managementClient = new ManagementClient({
  userPoolId: 'YOUR_USERPOOL_ID',
  secret: 'YOUR_USERPOOL_SECRET',
})

await managementClient.principal.authenticate({
  type: 'P',
  name: 'xxx',
  idCard: 'xxxxxxxxxxxxxxxx',
  bankCard: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
})

¶ return value

  • Promise<boolean>, certification successfully returned true

¶ Sample data

true
Prev: Management MFA Next: Java / Kotlin
  • Get a certification details
  • 进行主体认证

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.