【发布时间】:2018-05-10 18:00:10
【问题描述】:
在验证 Azure AD 颁发的令牌时,我在 startup.css 中出现错误
JwtBearerAppBuilderExtensions.UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)' 已过时:'参见 go.microsoft.com/fwlink/?linkid=845470';
我的代码是
app.UseJwtBearerAuthentication(new JwtBearerOptions
{
AutomaticAuthenticate = true,
AutomaticChallenge = true,
Authority = String.Format(Configuration["AzureAd:AadInstance"], Configuration["AzureAD:Tenant"]),
Audience = Configuration["AzureAd:Audience"],
});
我是 Azure 和 Web API 的新手,有什么建议吗? 谢谢
【问题讨论】:
-
您是否阅读了链接:github.com/aspnet/Security/issues/1310?身份验证在 2.0 中发生了一些变化,这种定义身份验证中间件的方式现在已经过时了。
-
嗨@juunas 感谢您的回复,是的,我已经检查了此链接,但无法弄清楚如何处理我的问题。如果您有一些代码或更多信息,那将很有帮助。
标签: asp.net-mvc asp.net-web-api jwt azure-active-directory asp.net-core-2.0