This folder contains the demo code for the blog post about the DPAPI Debugger .
This demo project requires: The debugger should work for most configurations, but this example is using the Azure Key Vault as described in an earlier blog post.
To get this sample to work you need:
- You have created an instance of Azure Key Vault
- You have created the necessary credentials (app registration) to access it, including Client ID, Client Secret and the Tenant ID. Set the following environment variables: AZURE_CLIENT_ID, AZURE_CLIENT_SECRET and AZURE_TENANT_ID to set the DefaultCredentials used in the application.
- At startup it will create a key ring in Azure Key Vault named MyKeyRing.
- Check the logs produced in the console window.
- Verify in Azure Key Vault that a new secret has been created.
- If you restart the application, it will at startup load the key ring from the vault.
- Optionally, you can encrypt the keys using a separate encryption key from Azure Key Vault.
- Click on the Debugger link in the application to view the details about the current DPAPI configuration.
- Introducing the Data Protection API Key Ring Debugger, the post for this demo.
- Persisting the ASP.NET Core Data Protection Key Ring in Azure Key Vault, the earlier post this demo builds on.
- Getting Started: Authentication and Authorization in .NET, my video course on Dometrain. It covers the authentication middleware and the cookie handler, and gives a short introduction to the Data Protection API.
This code was written by Tore Nestenius, a Microsoft .NET MVP and independent consultant and trainer from Göteborg, Sweden, specializing in authentication, identity and security in .NET.
See my blog for more at https://nestenius.se