AI OnAI Off
I think it sounds like you need to build a custom storage provider for ASP.NET Identity. https://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity
I would also look into building this as part of a separate IdentityServer4 app instead of bloating the Epi application with this type of stuff.
I need to create a custom OWIN Authentication that uses an external database to authorize users in CMS and I'm not sure how to insert it into Episerver. I have started with the latest Alloy demo and looking here for information, but I'm not clear on where the SecurityEntityProvider or should I be overriding the app in the Extned the Cms Asp.NetIdentity section? Any help would be appreciated.