Integrating with IdentityServer

Integrating AdminUI with your Existing IdentityServer Deployment

ASP.NET Core Identity

AdminUI uses a custom ASP.NET Core Identity schema. This schema extends from the ASP.NET Core Identity Entity Framework defaults, meaning any registration, password reset or login functionality you might already have, will continue to work with the AdminUI user store.

However, any existing users will need to be exported to use the AdminUI schema. For more details, see the Migrating to the IdentityExpress Identity Schema section of this article.

This schema is available in the nuget package IdentityExpress.Identity. Check out the Admin UI IdentityServer integration example for a working IdentityServer installation using this nuget package and schema.

IdentityServer

Existing installations of IdentityServer need no changes, as long as IdentityServer and AdminUI are using the same database.

Migrating to the IdentityExpress Identity Schema

For migrating users to the AdminUI identity schema, we support the automatic migration of users from the ASP.NET Core Identity Entity Framework schema.

A migration will be attempted on first run of AdminUI if the following conditions are met:

  • The database for IdentityConnectionString has no users
  • The configuration settingIdentityDatabaseToMigrateConnectionString is set
  • The IdentityConnectionString and IdentityDatabaseToMigrateConnectionString are not equal

Using the IdentityExpress Identity Schema

To use the IdentityExpress Identity schema used by AdminUI, you simply need to update your existing ASP.NET Identity registrations to look like the following:

// Register Identity using IdentityExpress entities and stores
services.AddIdentity<IdentityExpressUser, IdentityExpressRole>()
  .AddUserStore<IdentityExpressUserStore>()
  .AddRoleStore<IdentityExpressRoleStore>()
  .AddIdentityExpressUserClaimsPrincipalFactory();

// Register the DbContext for the IdentityExpress schema
services.AddDbContext<IdentityExpressDbContext>();

Or you can use our shortcut extension method:

services.AddIdentityExpressAdminUiConfiguration()
  .AddIdentityExpressUserClaimsPrincipalFactory();

Any existing registrations for SignInManager's, or usages of IdentityUser, should also be updated.