1# Authentication Widget 2 3## Introduction 4 5The Authentication Widget works with the User Authentication Framework (user_auth_framework) to provide a user authentication interaction interface when the user_auth_framework processes user authentication requests. The user interface provided by the authentication widget supports custom display information and provides buttons for the user to switch the authentication mode or cancel the authentication. 6 7**Figure 1** Authentication Widget architecture 8 9<img src="figures/authwidget_architecture_en.png" alt="authentication widge architecture"/> 10 11## Directory Structure 12 13``` 14//base/useriam/auth_widget 15├── entry # entry module code 16│ ├── src/main 17│ │ ├─ets 18│ │ │ └─extensionability # Implementation of system dialog boxes 19│ │ │ └─common # Common components and utils 20│ │ │ └─pages # Dialog boxes displayed during the user authentication 21│ │ │ └─image # Preinstalled icon resources 22│ │ └─resources # Resource files 23│ │ └─module.json5 # Global configuration file 24│ └─ src/ohostest # Unit test implemented by arkXTest 25├── signature # Certificates 26└── LICENSE # License file 27└── figures # Figures used in the README 28``` 29 30## Building the Authentication Widget 31 32In the root directory of the OpenHarmony source code, run the following command to build the Authentication Widget separately: 33 34``` 35./build.sh --product-name rk3568 --ccache --build-target auth_widget 36``` 37 38> **NOTE** 39> 40> --**product-name** specifies the product name, for example, **rk3568**. 41> 42> --**ccache** specifies the cache function used during the compilation. 43> 44> --**build-target** specifies the component to build. 45 46## Usage 47 48### Usage Guidelines 49 50- The Authentication Widget provides the default user identity authentication interface. For details about how to use the APIs, see the API reference of the User Authentication Framework. Use the **getUserAuthInstance** method with the widget to create an authentication instance, use the **AuthParam** to specify authentication parameters, and use **WidgetParam** to specify widget display parameters. 51- To ensure consistent user identity authentication experience, the authentication APIs that do not provide the user authentication interface will be deprecated. You are advised to use the authentication APIs provided by API version 10. 52 53## Repositories Involved 54 55**[useriam_user_auth_framework](https://gitee.com/openharmony/useriam_user_auth_framework)** 56