I'm successfully signing in and out using Azure AD B2C in a Blazor Server app, but it's not clear to me the proper way to define the SignedOut page. This question seems to be more applicable to Microsoft.Identity.Web.UI, because this SignedOut page seems to be hardcoded to a very generic SignedOut.cshtml:
Signed out
You have successfully signed out.
The documentation seems to indicate this can be changed, but it does not say how exactly.
From the documentation: "By default, the logout URL displays the signed-out view page SignedOut.cshtml.cs. This page is also provided as part of MIcrosoft.Identity.Web."
Given I'm writing a Blazor app, I tried creating a SignedOut.razor component, but that did not override it:
@page "/MicrosoftIdentity/Account/SignedOut"
Here is the source from Microsoft.Identity.Web.UI. As you can see it's hardcoded.
public IActionResult SignOut([FromRoute] string scheme)
{
if (AppServicesAuthenticationInformation.IsAppServicesAadAuthenticationEnabled)
{
return LocalRedirect(AppServicesAuthenticationInformation.LogoutUrl);
}
else
{
scheme ??= OpenIdConnectDefaults.AuthenticationScheme;
var callbackUrl = Url.Page("/Account/SignedOut", pageHandler: null, values: null, protocol: Request.Scheme);
return SignOut(
new AuthenticationProperties
{
RedirectUri = callbackUrl,
},
CookieAuthenticationDefaults.AuthenticationScheme,
scheme);
}
}