public async Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) { var defaultScheme = await _schemes.GetDefaultSignOutSchemeAsync(); var cookieScheme = await context.GetCookieAuthenticationSchemeAsync(); if ((scheme == null && defaultScheme?.Name == cookieScheme) || scheme == cookieScheme) { // this sets a flag used by the FederatedSignoutAuthenticationHandlerProvider context.SetSignOutCalled(); // back channel logout var logoutContext = await _session.GetLogoutNotificationContext(); if (logoutContext != null) { await _backChannelLogoutService.SendLogoutNotificationsAsync(logoutContext); } // this clears our session id cookie so JS clients can detect the user has signed out await _session.RemoveSessionIdCookieAsync(); } await _inner.SignOutAsync(context, scheme, properties); }
private async Task VerifyAllDefaults(IAuthenticationSchemeProvider provider, AuthenticationScheme?expected) { Assert.Equal(await provider.GetDefaultForbidSchemeAsync(), expected); Assert.Equal(await provider.GetDefaultAuthenticateSchemeAsync(), expected); Assert.Equal(await provider.GetDefaultChallengeSchemeAsync(), expected); Assert.Equal(await provider.GetDefaultSignInSchemeAsync(), expected); Assert.Equal(await provider.GetDefaultSignOutSchemeAsync(), expected); }
public async Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) { var defaultScheme = await _schemes.GetDefaultSignOutSchemeAsync(); if (scheme == null || scheme == defaultScheme.Name) { context.SetSignOutCalled(); _session.RemoveSessionIdCookie(); } await _inner.SignOutAsync(context, scheme, properties); }
public async Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) { var defaultScheme = await _schemes.GetDefaultSignOutSchemeAsync(); var cookieScheme = await GetCookieAuthenticationSchemeAsync(); if ((scheme == null && defaultScheme?.Name == cookieScheme) || scheme == cookieScheme) { await _session.RemoveSessionIdCookieAsync(); } await _inner.SignOutAsync(context, scheme, properties); }
public async Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) { var defaultScheme = await _schemes.GetDefaultSignOutSchemeAsync(); var cookieScheme = await context.GetCookieAuthenticationSchemeAsync(); if ((scheme == null && defaultScheme?.Name == cookieScheme) || scheme == cookieScheme) { // this sets a flag used by middleware to do post-signout work. context.SetSignOutCalled(); } await _inner.SignOutAsync(context, scheme, properties); }
public Task <AuthenticationScheme> GetDefaultSignOutSchemeAsync() { return(_inner.GetDefaultSignOutSchemeAsync()); }