Overview
This page assumes you have read the AdminUI installation documentation area.
When using the AdminUI NuGet package in your web applications, you can use the default stores, partially extend the default stores, or write your own stores.
This opens up AdminUI to users who may have not been able to take advantage of it in the past. Namely:
- Users who have Users, Roles or Claim Types that do not adhere to the default Identity schema the ability to write code that allows them to be managed via AdminUI.
- Users that require the extension of the existing identity stores.
Changes
AdminUI’s identity model has historically been based on the ASP.NET Identity model provided by Microsoft. This means “Identity” is composed primarily of Users, Roles, Claims and their associated Claim Types. This includes using the UserManager and RoleManager provided with ASP.NET Identity
AdminUI has a group of abstractions that allow for the decoupling from this old identity model.
The group of abstractions are:
- ISSOUserStore – Handles CRUD operations relating to users
- ISSOClaimTypeStore - Handles CRUD operations relating to claim types
- ISSORoleStore - Handles CRUD operations relating to roles
These store abstractions are initialized in AdminUI's service layer using ISSOStoreFactory
.
Starting point
To get started, take the result of the Installation and update the service registration to the following:
builder.Services.AddAdminUI().WithIdentityStore<SSOStoreFactory>();
Currently the WithIdentityStore<>()
method is using the default SSOStoreFactory from the AdminUI NuGet package, which is the default factory used within AdminUI.
Additional Configuration
The AddAdminUI method takes in additional configuration that is used to tell AdminUI if you are using a custom store or if you want to configure the migrations that run on startup.
builder.Services
.AddAdminUI(options =>
{
options.IdentityType = IdentityType.DefaultIdentity;
})
.WithIdentityStore<CustomStoreFactory>();
IdentityType is a pair of enums:
- DefaultIdentity
- This the default option. Use this if need any of AdminUIs identity services e.g you are not using a custom identity store or are using a partial implementation that uses any of AdminUIs identity services (IIdentityUnitOfWorkFactory etc)
- CustomIdentity
- Select this to disable the default AdminUI identity services - used for full custom identity store implementations
Next Steps
Partial Implementation
Will outline how to wrap the existing stores, how to override certain calls, and how to manage additional fields on your Identity models.
Full Implementation
Will outline how to build your own AdminUI compatible Identity store from scratch.
We also provide a MongoDB example of a full implementation.