【发布时间】:2016-10-01 05:05:41
【问题描述】:
我注意到很多Owin.Security 的东西都在Microsoft.AspNetCore.Authentication 命名空间中。
喜欢
Microsoft.AspNetCore.Authentication.Cookies
Microsoft.AspNetCore.Authentication.Facebook
Microsoft.AspNetCore.Authentication.JwtBearer
但是对于传统 ASP.NET 中的 Micosoft.Owin.Security.ActiveDirectory 等效项,名为 Microsoft.AspNetCore.Authentication.ActiveDirectory 的包实际上不是来自 Microsoft,而是来自某些 OneBitSoftware。托管here。
我很好奇 ActiveDirectory 命名空间是否已重命名为 JwtBearer 或 OpenIdConnect 或 OAuth。但似乎没有人像这样与 AzureAD 一起工作:
var options = new WindowsAzureActiveDirectoryBearerAuthenticationOptions
{
Tenant = ...
}
我尝试使用 AzureAD 进行身份验证,没有ActiveDirectory,我应该使用哪个 NuGet 包?
更新
ASP.NET docs site 中的示例相当陈旧。像
这样的包"Microsoft.AspNet.Security.OAuthBearer": "1.0.0-beta3",
不再用于最新的 Asp.net 核心。
【问题讨论】:
-
你应该可以使用 JwtBearer 作为替代。
标签: cors asp.net-core azure-active-directory