In my AccountController under beta4 of ASP.NET vNext, we were logging out by using:
Context.Response.SignOut(OpenIdConnectAuthenticationDefaults.AuthenticationScheme);
Context.Response.SignOut(CookieAuthenticationDefaults.AuthenticationType);
This worked great and the user ended up on the login page of Office 365 as we expected.
After updating to beta6, the SignOut method was shown as an error. We replaced it with the below, but the logout never seems to correctly happen. The user is immediately thrown back to the Home Page logged in. I have tried SignOutAsync and ForbidAsync and even both of them together, but still can't log user out since update.
var properties = new AuthenticationProperties
{
AllowRefresh = false,
ExpiresUtc = DateTime.UtcNow.AddDays(-1),
IsPersistent = true,
RedirectUri = "/",
IssuedUtc = DateTime.UtcNow
};
await Context.Authentication.SignOutAsync(OpenIdConnectAuthenticationDefaults.AuthenticationScheme, properties);
await Context.Authentication.SignOutAsync(CookieAuthenticationDefaults.AuthenticationType, properties);
What is the recommended (or any) way to correctly log out a user in beta6 and have them re-directed to the Office 365 login screen?
{ }
button (or four spaces) to format a code block. Only use ` for inline code.