I am developing a Blazor Web Assembly app in Visual Studio that uses Azure AD B2C for authentication. It is all setup and working well except that developing is a chore because each time I want to launch the debugger and open the browser to review my work I am required to login in again to view pages that require authentication. This is a time consuming and annoying step that I would hope to avoid.
Ideally there would be a way to stay logged in between debug browser sessions launched from Visual Studio.
I have searched for the answer on the web with not luck yet. Anyone have any ideas on how to do this?
In Program.cs, set MsalCacheOptions.CacheLocation to "localStorage"
Example:
builder.Services.AddMsalAuthentication(options =>
{
// Keeps logged in between debugging sessions
options.ProviderOptions.Cache.CacheLocation = "localStorage";
// Set up other options
...
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With