.net 项目下面的写法会 logout:
public class LogoutController : ControllerBase { public IActionResult Index() { return SignOut("Cookies", "OpenIdConnect"); } } app.MapGet("/logout", (HttpContext cxt) => { return Results.SignOut(null, new[] { "Cookies", "OpenIdConnect" } ); });
the effects are same!
For the first snap, is just a static method. new SignOutResult(authenticationSchemes);
the object finally call httpContext.SignOutAsync(AuthenticationSchemes[i], Properties);
how httpContext logout? SignOutAsync is just a extensive method which get the IAuthenticationService and logout.
we can also call GetTokenAsync() to get access_token or id_token,when we use OIDC
标签:SignOutAsync,just,netcore,signOut,Authentication,asp,logout,httpContext From: https://www.cnblogs.com/qgbo/p/17028492.html