---
title: Full Override
---

##Using Your Own Custom Identity Store
Samples of the below code can be found on our [GitHub](https://github.com/RockSolidKnowledge/Samples.CustomIdentityStore/tree/main/Duende)

For this part of the documentation the code in [Base Installation](https://github.com/RockSolidKnowledge/Samples.CustomIdentityStore/tree/main/Duende/Base%20Installation) project will be considered the "Before".

##Getting Started - Using the Rsk.CustomIdentity Interfaces

The `Rsk.CustomIdentity` package contains the required modal and store interfaces required to build an AdminUI compatible Identity store. 

Models:

- ISSOUser
- ISSOClaimType
- ISSORole

Store interfaces:

- ISSOUserStore
- ISSOClaimTypeStore
- ISSORoleStore

An implementation of `ISSOStoreFactory` is also required. `ISSOStoreFactory` will return the concrete implementations of the `ISSOUserStore`, `ISSORoleStore`, and `ISSOClaimTypeStore`

SSOClaimStore:

```language-csharp
public class ClaimTypeStore : ISSOClaimTypeStore
{
    public Task<ISSOClaimType> GetClaimTypeByName(string name)
    {
        throw new NotImplementedException();
    }
    ...
```

SSORoleStore:

```language-csharp
public class RoleStore : ISSORoleStore
{
    public Task<ISSORole> CreateRole(ISSORole role)
    {
        throw new NotImplementedException();
    }
    ...
```

SSOUserStore:

```language-csharp
public class UserStore : ISSOUserStore
{
    public Task<ISSOUser> CreateUser(ISSOUser user)
    {
        throw new NotImplementedException();
    }
    ...
```

SSOStoreFactory:

```language-csharp
public class SSOStoreFactory : ISSOStoreFactory
{
    public ISSOUserStore CreateUserStore()
    {
        return new UserStore();
    }

    public ISSORoleStore CreateRoleStore()
    {
        return new RoleStore();
    }

    public ISSOClaimTypeStore CreateClaimTypeStore()
    {
        return new ClaimTypeStore();
    }
}
```

Once you have provided an implementation of these interfaces, you can update your the pipeline registration for AdminUI in your `Program.cs` or `Startup.cs` class to:

```language-csharp
builder.Services
    .AddAdminUI(options =>
    {
        options.IdentityType = IdentityType.DefaultIdentity;
        options.MigrationOptions = MigrationOptions.All;
    })
    .WithIdentityStore<CustomStoreFactory>();
```

This will register your new `ISSOStoreFactory` implementation as the factory to use when the AdminUI service layer requests and manages Users, Roles, and Claim Types.
Additionally, you must also specify to the package that you are using a custom identity implementation. 

Calling WithIdentityStore will stop AdminUI from running bootstrap, if you would still like to have the default bootstrapped users and roles you can take away this call, run the application and then add it back in.

The code from this section can be [found here](https://github.com/RockSolidKnowledge/Samples.CustomIdentityStore/tree/main/Duende/Full%20Implementation%20Starting%20Point)

The next section will use Tenancy as an example of how to transform additional fields to claims, alongside using extra tables as dynamic provider for the Enum claim type:

[EfCore](TenancyWithEF.md)

