I am migrating an app from Sitecore 8 to 10. The existing app was built with .Net 4.6.1 and uses Microsoft AspNet Identity and Owin for user access.
The Startup class uses the OwinStartupAttribute annotation:
And the Startup class includes setting up the user and signin managers:
app.CreatePerOwinContext(ApplicationDbContext.Create); app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
After migrating to Sitecore 10.1.1 and attempting to login to the app as was done previously, the call to find a user by email fails with:
System.ArgumentNullException: Value cannot be null. Parameter name: manager at Microsoft.AspNet.Identity.UserManagerExtensions.FindByEmail[TUser,TKey](UserManager`2 manager, String email)
I see in appSettings that Sitecore 10 is now registering it's own Owin Startup:
<add key="owin:appStartup" value="Sitecore.Owin.Startup, Sitecore.Owin" />
I have found that if I comment this out of appSettings, the user application's login works just fine; but Sitecore's admin login no longer works. And if I leave it in appSettings, the opposite is true - Sitecore's Admin login works and the user application's login fails with the error above.
I haven't had much success in finding how to integrate so that both logins can work independently with their own separate stores and login screens like it was working in Sitecore 8. The Sitecore 10 that we are deploying to will be using the newer Sitecore Identity. Is there a good reference for doing this?