Mid ASP.NET Core

Data protection (for cookies, tokens)?

ASP.NET Core uses Data Protection API to:

  • Encrypt authentication cookies
  • Protect tokens (e.g., password reset tokens)

Configure:

services.AddDataProtection()

.PersistKeysToFileSystem(new DirectoryInfo("path"))

.SetApplicationName("AppName");

Used internally by Identity and cookie middleware.

More from ASP.NET Core Tutorial

All questions for this course