¶ Management subject certification
Update Time: 2025-02-18 09:00:47
This module is used to conduct body authentication, such as personal authentication or corporate certification.
Initialization module
from authing.v2.management import ManagementClient, ManagementClientOptions
management_client = ManagementClient(
options=ManagementClientOptions(
user_pool_id='AUTHING_USERPOOL_ID',
secret='AUTHING_USERPOOL_SECRET',
))
management.principalAuth.detail() # Get an authorization details
management.principalAuth.authenticate() # Authorize
¶ Get a certification details
Get the main authentication details
def detail(self, user_id)
¶ parameter
user_id
<str> User ID
¶ Example
management.principalAuth.detail("6139c4d24e78a4d706b7545b")
¶ Example 数据
{
"message": "获取主体认证信息成功",
"code": 200,
"data": {
"id": "60b4d72f56b49fb97281001b",
"createdAt": "2021-05-31T12:31:43.416Z",
"updatedAt": "2021-05-31T12:31:43.416Z",
"userPoolId": "607fe30c14d1650eb1d888ca",
"userId": "60a336dc179abb512dd64ae7",
"principalType": "P",
"principalName": "xxx",
"principalCode": "xxxxxxxxxxxxxxx",
"authenticationTime": "2021-05-31T12:31:43.414Z"
}
}
¶ Subject authentication
Subject authentication
def authenticate(self, user_id, type, name, id_card, ext)
¶ parameter
user_id
<str> User IDtype
<str>Type value is only p or ename
<str> nameid_card
<str>- When Type is P, a personal ID card
- When Type is E, enterprise unified credit coding
ext
<str>- When Type is P, the bank card number
- When Type is E, the corporate legal person name
¶ Example
management.principalAuth.authenticate("6139c4d24e78a4d706b7545b","P","nn","xx","cq")