From the course: Deploying ASP.NET Core Applications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Set up data protection

Set up data protection

From the course: Deploying ASP.NET Core Applications

Start my 1-month free trial

Set up data protection

- [Instructor] ASP.NET Core uses the data protection API or DP API to encrypt and store keys that are used for authentication in your application. When hosting your application with IIS, you'll need to run a small script to create a registry hive for these keys, otherwise the keys will be regenerated when you restart the application or your server, which will invalidate any user sessions or cookies that were encrypted with the previous old keys. To create a data protection registry hive, you'll need a PowerShell script that's provided by the ASP.NET Core team. It's linked to from the ASP.NET Core documentation. It's hosted on GitHub, and to download it, you'll have to click the raw button on GitHub to display the raw text of the script. Then right click and choose save as. I'm gonna try saving it to the desktop just to make it easy. You'll need to put quotes around the file name so that the extension is saved properly and then click Save. Now that I have the script downloaded, I need…

Contents