c# - 身份服务器 4 故障排除

标签 c# debugging .net-core identityserver4

我正在使用 Identity Server 4 进行身份验证。我有 MVC 客户端。几天前,我能够成功进行身份验证。但最近我在 Identity Server 项目中做了一些改变,这破坏了一些东西。我得到了

unauthorized_client The client application is not known or is not authorized.

我尝试了所有可能的修复方法,但无法修复它。有什么办法可以调试代码。我可以看到调用了 /connect/authorize 端点并且调用将转到 IScopeStore.FindScopesAsyncIClientStore.FindClientByIdAsync 我验证了它具有所有正确的 AllowedScopes

谁能告诉我如何使用 Identity Server 4 解决此类问题。另外,我很想知道执行流程。什么时候调用 IDSvr 端点?

最佳答案

您的问题可以是任何问题。启用日志记录到控制台,你可以找出它是什么。 Identity Server 4 默认使用 asp.net 核心记录器提供程序进行内部记录。

Startup.cs 中的 Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) 方法中。通过 loggerFactory.AddConsole(LogLevel.Trace); 添加控制台日志记录,并确保在 project.json 中包含记录器扩展包 "Microsoft.Extensions.Logging.Console": "1.0 .0",.

关于c# - 身份服务器 4 故障排除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39611172/

相关文章:

c# - MVC - 设置 SelectList 的选定值

java 调试不能正确显示当前行

c# - 在 Docker 上调试会抛出错误

c++ - 变量值的后缀#DEN 是什么意思

c - C : Declaration of Functions简介

build - .NET CORE 构建导致 vscode 中的重复错误

c# - 从 .NET 3 迁移到 .NET 5 时,Azure Function 中出现错误 "Did not find functions with language [dotnet-isolated]"

c# - 枚举值字典作为字符串

c# - '控制台'不包含 asp.net 5 控制台应用程序中 'ReadKey' 的定义

c# - 发送 HTTP header 后服务器无法修改 cookie,如何修复?