README.md
1# User Identity Management (useridm)
2
3
4## Introduction
5
6As a basic component of the user Identity & Access Management (IAM) subsystem, User Identity Management (useridm) provides a unified interface for managing user credential information in the system and invokes authentication resources through the authentication executor management module to implement lifecycle management and secure storage of user credentials.
7
8**Figure 1** useridm architecture
9
10<img src="figures/useridm_architecture.png" alt="useridm_architecture" style="zoom:80%;" />
11
12## Directory Structure
13
14```undefined
15//base/user_iam/user_idm
16├── frameworks # Framework code
17├── interfaces # Directory for storing external interfaces
18│ └── innerkits # Header files exposed to the internal subsystems
19├── sa_profile # Profile of the Service ability
20├── services # Implementation of the Service ability
21├── unittest # Directory for storing test code
22├── utils # Directory for storing utility code
23├── bundle.json # Component description file
24└── useridm.gni # Build configuration
25```
26
27
28## Usage
29
30### Available APIs
31
32**Table 1** APIs for managing user credentials
33
34| API | Description |
35| ------ | -------------------------------- |
36| addCredential(credentialInfo : CredentialInfo, callback : IIdmCallback) : void; | Adds a user credential.|
37| updateCredential(credentialInfo:CredentialInfo, callback:IIdmCallback) : void; | Updates a user credential.|
38| delUser(token : Uint8Array, callback : IIdmCallback) : void; | Deletes a Personal Information Number (PIN). When a PIN is deleted, all authentication credentials of the user are also deleted.|
39| delCred(credentialId : Uint8Array, token : Uint8Array, callback : IIdmCallback) : void; | Deletes a user credential.|
40
41**Table 2** API for querying user credential information
42
43| API| Description |
44| ------ | -------------------------------- |
45| getAuthInfo(callback : AsyncCallback<Array<EnrolledCredInfo>>,authType? : AuthType) : void; | Obtains one or all types of authentication credentials of a user.|
46
47### Usage Guidelines
48
49- The APIs defined in the header file ```common\interface\useridm_interface.h``` in the [useriam_auth_executor_mgr](https://gitee.com/openharmony-sig/useriam_coauth) repository must be implemented in a Trusted Execution Environment (TEE). In addition, the association between the user credentials and user IDs should not be tampered with, and unified user authentication must be supported.
50- During the adaptation, vendors can refer to the software implementation of related functions provided by the OpenHarmony framework.
51
52## Repositories Involved
53
54[useriam_auth_executor_mgr](https://gitee.com/openharmony/useriam_auth_executor_mgr)
55
56**[useriam_user_idm](https://gitee.com/openharmony/useriam_user_idm)**
57
58[useriam_user_auth](https://gitee.com/openharmony/useriam_user_auth)
59
60[useriam_pin_auth](https://gitee.com/openharmony/useriam_pin_auth)
61
62[useriam_faceauth](https://gitee.com/openharmony/useriam_faceauth)
63