我可以通过枚举User.Identities读取调用UseCookieAuthentication时设置的AuthenticationType,但它不包括我使用UseOpenIdConnectAuthentication设置的AuthenticationType。 我需要两者都可以使用 SignOut 成功注销。 如何获取我在 UseOpenIdConnectAuthentication 中设置的 AuthenticationType?
我终于在另一篇文章中找到了答案。
https://stackoverflow.com/a/38567468/4194514
Request.GetOwinContext()
.Authentication
.SignOut(HttpContext.GetOwinContext()
.Authentication.GetAuthenticationTypes()
.Select(o => o.AuthenticationType).ToArray());