Search code examples
c#asp.net-coreblazorblazor-client-sideblazor-webassembly

.net core 3.1 Blazor WebAssembly: does not contain a definition for "LoginMode"


I am currently trying to change the default of popup to redirect upon logging in.
I am using .NETCORE 3.1 Blazor WebAssembly any help would be great! Thanks!

code block

csproj packages


Solution

  • According to this github issue that the redirect mode only supported in the asp.net core 5.0.

    If your application is 3.1, it will not work well.

    If you migrate to 5.0, then you could use below codes to use redirect instead of popup.

    builder.Services.AddMsalAuthentication(options =>
    {
        ...
        options.ProviderOptions.LoginMode = "redirect";
    });
    

    More details ,you could refer to this article.