AuthorizationServerDemos/CSharp/OidcSamples/OidcSamples.TaxApp/Controllers/AuthenticationController.cs
2021-01-10 14:15:47 +03:00

20 lines
623 B
C#

using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace OidcSamples.TaxApp.Controllers
{
[Route("[controller]")]
public class AuthenticationController : Controller
{
[HttpGet("Logout")]
public async Task Logout()
{
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
await HttpContext.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme);
}
}
}