身份服务器 /connect/token 出现空 500 错误 - 如何找到错误消息?

Identity server /connect/token giving empty 500 error - how can I find error message?

我有一个托管在 IIS 中的 Identity Server 4 应用程序,我已将其部署到新环境(相同的代码在其他环境中运行良好)。当一个单独的应用程序点击 /connect/token 端点时,它 returns 500,但没有任何内容。如何找到导致此问题的错误?

在 IIS 管理器中,打开 Identity Server 应用程序。单击 Configuration Editor,然后查看 system.webServer/aspNetCore 部分。将 stdoutLogEnabled 更改为 true(如果尚未更改),然后再次点击终点。 stdoutLogFile 设置显示日志文件的位置(如果它们在文件夹中,您可能需要手动创建文件夹)。日志文件将包含异常消息和堆栈跟踪。