Microsoft provides several ways to gain secure access to Azure Key Vault secrets, particularly using Managed Identity or Service Principals as identity providers. However, these methods are explicitly designed to work with Azure-based resources such as web apps and microservices. They do NOT work with UWP/WinUI desktop applications.
The only method I've discovered so far to allow a UWP/WinUI desktop application access to Key Vault is to load the app's Azure registration info (TenentId, ClientId and ClientSecret -- secrets, themselves!) into environment variables that get picked up by the DefaultAzureCredential() method when creating a new SecretClient object (Azure.Security.KeyVault.Secrets).
But that means I'd need to store THESE secrets either in code or in a configuration file to be read in at run-time. Definitely NOT a best practice! I must be missing something.
What are the best practices in 2020 for UWP/WinUI desktop applications to SECURELY access Key Vault secrets -- without exposing other secrets in the process?