I am searching on the way for safe storage of app secrets in blazor webassembly application. We can find details for Server Side application as in below MSDN documentation.
https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1&tabs=windows
How can we use these kind of secrets for Blazor WebAssembly application which completely runs in client browser?
My basic scenario is, need to keep the passwords, product key (licensing key) information out of application code. For example, we load license inside the static main method of Program.cs.
https://i.sstatic.net/kCrV1.png
public class Program
{
public static async Task Main(string[] args)
{
//want to access the product key here and need to avoid hardcoding
SomeThirdPartyLibrary.RegisterLicense("product-key");
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();
}
I have searched in documentation of blazor and not able to find any details for this. Please help me to find the recommended way resolving this in Blazor webassembly.
(for server-side, we have variety of option but for client-side what might be the recommended way)