Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect to Login page as opposed to pop-up Login in Blazor

I have a Blazor WebAssembly app that uses Azure AD B2C for authentication.

builder.Services.AddMsalAuthentication(options =>
{
    builder.Configuration.Bind("AzureAdB2C", options.ProviderOptions.Authentication);
});

When the user is redirected to authentication, Blazor display the login in a pop-up.

The problem with the pop-up is that the user could bury it if they clicked on the screen outside of the pop-up.

Wondering if there is a way to force the authentication to redirect to the page as opposed to displaying the pop-up.

like image 242
mattruma Avatar asked Oct 15 '22 02:10

mattruma


1 Answers

To change from the pop-up page to a redirect you need:

options.ProviderOptions.LoginMode = "Redirect";
like image 58
Mrcl1450 Avatar answered Oct 21 '22 07:10

Mrcl1450