3
votes

I have an application based on DNN (a bunch of DNN modules) and would like to gradually migrate this app to plain ASP.NET Core. (getting away from DNN) I'm only depending on DNN user management and navigation, all the rest is basically plain ASP.NET Web Forms. (or better: Web User Controls in DNN)

The plan is to create a brand new app (different sub-domain) and first migrate my user management to .NET Core Identity. Users would login via the new app and will need to switch between the Core App and DNN during the migration period. I want to use the new identity based mechanism and would have to keep users in sync with the DNN Membership based tables until I can deprecate the last DNN module.

From: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity It seems identity creates its own cookie that is totally different from DNN. Does anyone know of a way to create a shared cookie that would allow users to move from the old to the new app without having to login twice? Or is there a better way to realize this functionality?

UPDATE: Doing more research and at this point it seems to make more sense to split this project up in 2 phases: 1. Start the new App using MVC 5 (for stability) 2. Migrate the MVC 5 App to .NET Core after a while

The question still remains for MVC 5 using OWIN authentication in this case. Would it be possible to create a shared auth cookie between MVC and DNN?

1
Looking at this post: link it seems this will not be easy. DotNetNuke requires a very specific cookie containing the user name that is encrypted with a MachineKey (from the web.config). Not sure if the owin cookie can be customized for this.Dabixi

1 Answers

0
votes

For anyone with the same problem, I found out that what I want to do is not possible. The format of authentication cookie has been changed with OWIN and there is no backwards compatibility with the previous FormsAuthentication.

I was able to create an OWIN cookie with the same name, MachineKey encryption, etc. but the content is different and DNN won't recognize this.

I will have to add an extra phase into my migration. 1. Create a new app with MVC 5 but use the old forms authentication 2. After all modules are migrated, I will be able to move to OWIN 3. Migrate to ASP.NET core