【发布时间】:2020-05-25 22:31:21
【问题描述】:
ASP.NET 框架
我们有一个现有的 ASP.NET Framework 网站,它使用 ActiveDirectoryFederationServicesBearerAuthentication 进行身份验证:
app.UseActiveDirectoryFederationServicesBearerAuthentication(
new ActiveDirectoryFederationServicesBearerAuthenticationOptions
{
MetadataEndpoint = ConfigurationManager.AppSettings["ida:AdfsMetadataEndpoint"],
TokenValidationParameters =
new TokenValidationParameters
{
ValidAudience = ConfigurationManager.AppSettings["ida:Audience"],
RequireSignedTokens = true
}
});
“ida:AdfsMetadataEndpoint”的值为:
https://
/FederationMetadata/2007-06/FederationMetadata.xml
我们有一个 ADFS 3.0 服务器(在 Windows Server 2012 R2 上运行)发布这些 JWT 令牌。
ASP.NET Core 3.1
由于我们正在将我们的网络服务器迁移到 ASP.NET Core 3.1,我们希望继续使用相同的 ADFS 3.0 服务器向我们的网站颁发 JWT 令牌。
但我在配置新服务器以验证来自 ADFS 3.0 服务器的令牌时遇到问题。这是我尝试过的:
JwtBearerAuthentication
据我了解,JwtBearerAuthentication 需要支持 OpenIDConnect 的 ADFS 4.0?
我找到了this 解决方法,它应该适用于我的情况,但是将颁发者签名密钥存储在我的应用程序中似乎有点麻烦。如果它在 ADFS 上发生变化怎么办?
WsFederationAuthentication
我关注了这个guide,但在我看来这不支持承载认证?
结论
使用 ADFS 3.0 发布的 JWT 不记名令牌的 ActiveDirectoryFederationServicesBearerAuthentication 的 ASP.NET Core 等效项是什么?
【问题讨论】:
标签: authentication asp.net-core jwt adfs3.0