c# - GetOwinContext 在 ASP.NET Core 中不起作用

标签 c# asp.net asp.net-core owin

它总是说HttpContext不包含GetOwinContext()的定义,我尝试下载.net core owin,但我不知道如何实现相同的功能。 下面的代码可以在asp.net 5中编译。

private IAuthenticationManager AuthenticationManager
{
    get
    {                
        return HttpContext.GetOwinContext().Authentication;
    }
}

最佳答案

Asp.Net core 没有 GetOwinContext()。请改用 HttpContext.Authentication

关于c# - GetOwinContext 在 ASP.NET Core 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39032627/

相关文章:

c# - Interlocked.Increment 字典值

asp.net - 为不同维度设计 ASP.NET 文件 uploader

c# - ASP.NET MVC CORE 中的 Controller 操作别名

c# - 为什么我的列表显示每个对象都是 "System.Collections.Generic.List` 1[System.DateTime]”

javascript - GeckoFX:脚本耗时太长对话框

c# - 调用 "Configure Data Source..."时出错。详情 : Exception has been thrown by the target of an invocation

c# - 在异步方法.net core中返回元组结果

c# - 在数据库中存储 RsaSecurityKey

c# - 如何在使用自定义窗口镶边时向 WPF 标题栏添加按钮?

asp.net - 使用 ASP.net 在 GridView 内使用 DropDownList 时,SelectedIndexChanged 不会触发