--- title: User Admin Feature --- ::: info When using ASP.NET Core **Identity Auth** refer to [Identity Auth Admin Users UI](/admin-ui-identity-users) instead ::: The User Admin Plugin is a lightweight API for providing user management functionality around Auth Repository APIs and enables remote programmatic access to manage your registered [User Auth Repository](/auth/authentication-and-authorization#user-auth-repository), featuring: - Works with existing `IUserAuthRepository` sync or async providers - Utilizes Progressive enhancement, e.g. search functionality utilizes `IQueryUserAuth` (if exists) performing a wildcard search over multiple fields, otherwise falls back to exact match on `UserName` or `Email` - Supports managing Auth Repositories utilizing custom `UserAuth` data models - Flexible UI options for customizing which fields to include in Search Results and Create/Edit UIs - Rich Metadata aggregating only App-specific Roles & Permissions defined in your App - User Events allow you to execute custom logic before & after each Created/Updated/Deleted User ### Installation The `AdminUsersFeature` plugin contains no additional dependencies that at a minimum can be registered with: ```csharp Plugins.Add(new AdminUsersFeature()); ```
::: info An `IAuthRepository` is a required registered dependency to be able to use the `AdminUsersFeature` plugin. ::: ## Managing Users By default, the Add and Edit Users forms contains the default layout of common properties in [UserAuth.cs](https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/Auth/UserAuth.cs) ## Customization To customize this user interface to accommodate custom properties, the `UserFormLayout` needs to be overridden. For example, below we have a custom `UserAuth` called `AppUser` with additional properties. ```csharp // Custom User Table with extended Metadata properties public class AppUser : UserAuth { public Department Department { get; set; } public string? ProfileUrl { get; set; } public string? LastLoginIp { get; set; } public bool IsArchived { get; set; } public DateTime? ArchivedDate { get; set; } public DateTime? LastLoginDate { get; set; } } public enum Department { None, Marketing, Accounts, Legal, HumanResources, } ``` The `AdminUsersFeature` has multiple fiends that can be used to customize the UI including. | Property Name | Description | |---------------------------|--------------------------------------------------------------------| | `QueryUserAuthProperties` | Columns visible in query results for users. | | `QueryMediaRules` | Which columns *start* appearing at different screen sizes. | | `UserFormLayout` | Control which fields are used for Create/Edit and their placement. | ### Custom User Form Layout Similar to the [API Explorer](./api-explorer.md#formlayout) `FormLayout` customization, `UserFormLayout` is used to control placement and details about individual fields. ```csharp appHost.Plugins.Add(new ServiceStack.Admin.AdminUsersFeature { // Show custom fields in Search Results QueryUserAuthProperties = new() { nameof(AppUser.Id), nameof(AppUser.Email), nameof(AppUser.DisplayName), nameof(AppUser.Department), nameof(AppUser.CreatedDate), nameof(AppUser.LastLoginDate), }, QueryMediaRules = new() { MediaRules.ExtraSmall.Show