从Identity Server 4重定向不在.net核心2.2上工作

问题描述 投票:3回答:1

我正在关注Brian Noyes的Pluralsight.com教程,称为openid和oauth2,用于保护角度应用程序。

练习文件工作正常。当我将Identity Server(STS)升级到最新的asp.net core 2.2框架时,注销后的重定向会卡在DiscoveryKeyEndpoint的Start key discovery请求上

ASP.NET Core Identity Server Console Application

chrome中控制台上的错误消息如下

Error message on Chrome

当我们看到fiddler时,很明显返回的内容类型有问题。

这里是具有正确内容类型application / json和旧ASP.NET Core 1.0应用程序的工作示例

Working fiddler Redirect Header

这里是破坏的示例,其中包含不正确的application / jwk-set + json内容类型和新的ASP.NET Core 2.2应用程序

Broken fiddler Redirect Header

如何修复返回的这种奇怪的内容类型。

asp.net-core openid identityserver4
1个回答
4
投票

有一个GitHub issue描述了这里发生了什么。基本上,在oidc-client-js中引入了一个错误,导致从jwks端点返回的Content-Type头只有在它是application/json时才有效。

该问题已在1.5.2中修复,因此升级到该问题将解决您所看到的问题。该项目被称为oidc-client-js,但NPM包是oidc-client

© www.soinside.com 2019 - 2024. All rights reserved.