将IdentityServer AccessTokenValidation从版本3升级到4会导致HTTP 500.19

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

目前,我们有一个正在运行的ASP.NET WebAPI 2项目,该项目正在使用IdentityServer3.AccessTokenValidation进行编译和运行。卸载NuGet包并安装较新的IdentityServer4.AccessTokenValidation后,项目现在停止运行并出现HTTP错误500.19 - 内部服务器错误。我们已经尝试了很多东西,但我们不确定如何识别根问题并解决问题。始终如一地升级到IdentityServer4会重现错误。

详细错误信息:

Module:       CustomErrorModule
Notification: SendResponse
Handler:      Not yet determined
Error Code:   0x80070490
Config Error: The configuration section 'system.webServer/httpErrors' cannot be read because it is missing a section declaration
Config File:  \\?\C:\Users\joe\AppData\Local\dftmp\Resources\91a2e717-5753-4ca7-b31d-40e068e91e84\temp\temp\RoleTemp\applicationHost.config

目前Startup.cs中的所有Identity Server代码都被注释掉了,所以唯一的变化就是替换IdentityServer库,可靠地重新创建这个问题

对于附加上下文,这里有一些细节:

  • 这是Web API 2
  • .NET 4.6
  • 这将作为Azure云服务托管,但目前我们只是在本地工作,直到我们确定问题为止
  • 我们没有定义httpErrors部分,并添加一个对错误的存在没有影响的部分
  • 此列出的文件不存在
  • 我们没有对权限进行任何更改,因此不应该使用Cloud Service

更新1

经过额外的分析后,我们观察到了另一个错误,这个错误发生在上述问题之前。我们已经确认在评论中提到的“干净”VM上也发生了同样的事情

详细错误信息:

Module:       CustomErrorModule
Notification: SendResponse
Handler:      ExtensionlessUrl-Integrated-4.0
Error Code:   0x80070002
Config Error: Cannot read configuration file
Config File:  applicationHost.config

我们的配置部分包含以下处理程序。这些都不会作为升级的一部分而更改,并且删除它不会对错误产生任何影响

<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
asp.net-web-api identityserver4
1个回答
1
投票

V4仅适用于ASP.NET Core ...

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