Azure B2C: User not logged out after logoutURI
Hi,
I've configured a B2C tenant and built a .NET MVC app to use it as a login. Now, I'm trying add an option for the user to sign out, so a different account can be selected. Signing out of the app is easy, I just do
await HttpContext.SignOutAsync("Cookies");
await HttpContext.SignOutAsync("OpenIDConnect");
but the issue is, when I log back in, I never get prompted to select an account, it defaults to the previous account, that still logged in with the B2C tenant. So next step, also log out of the B2C when the logout is called. I tried to do this by calling
logoutUrl = $"{azureAdB2COptions["Instance"]}{azureAdB2COptions["Domain"]}/b2c_1a_signup_signin/oauth2/v2.0/logout?" + $"post_logout_redirect_uri={Uri.EscapeDataString("https://localhost:7043/")}";
This runs fine, no errors, but the issue I had still persists! The user never gets logged out! This conflicts with all the information I find online. Any idea what causes this, the user is never logged out of the B2C tenant, or is instantly logged back in. I added this in my Program.cs
options.Prompt = "select_account";
but no luck. Any help is appreciated. Thank you.