I have 2 application one in MVC 5 and another on asp.net core 2.2
I have added Machine Key On MVC 5 under system.web like below
<machineKey
validationKey="0C0D6B2776BE432EE3B1554D5C8F88C168944B7E9B7A0FFC885DDE9E9AFA093A"
decryptionKey="09CCCB69B54D74DB1C2379AB13371EA3D6743227BE6E0092EA3FB762D53668A6"
validation="SHA1"
decryption="AES"
/>
I want to apply the same key for .net core. I found some link to use data protection but I failed to add these keys to that.
Is there any way we can apply the key to the asp.net core
ASP.NET Core doesn't use
web.config, and even if it did, it doesn't use machine keys either. Cryptography is handled via the Data Protection, which stores and generates keys in an entirely different way.If you need to share things like cookies between ASP.NET and ASP.NET Core, you have to work in the opposite way and plug in the
Data Protection APIinto your ASP.NET apps, so that they use the same system as ASP.NET Core.Reference:
https://learn.microsoft.com/en-us/aspnet/core/security/cookie-sharing?view=aspnetcore-3.1