Asp.Net Core Web API 中 IdentityServer 的哪个 Nuget 包?

Which Nuget package for IdentityServer in Asp.Net Core Web API?

我有两个 Web 应用程序需要身份验证和授权功能。服务器端 运行s Asp.NET Core 3.0,客户端 运行s Angular 并且我打算使用代码交换 (PKCE) 流程的证明密钥来实现 IdentityServer。官方 IdentityServer 文档 (https://identityserver4.readthedocs.io) refers to package IdentityServer4 while the dotnet templates (https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-api-authorization?view=aspnetcore-3.0) 使用 Microsoft.AspNetCore.ApiAuthorization.IdentityServer 。我找不到对后一个包的正确描述,它被列为 IdentityServer 的一个实现。但是两个包之间可用的配置方法是不同的。

我想 运行 IdentityServer 作为我的 web 应用程序中的中间件,并发布 PKCE 密钥来完成身份验证和授权。我不确定 IdentityServer4 是否可以 运行 作为我的主应用程序中的中间件,或者是否需要在它自己的应用程序中作为中间件,我不确定 Microsoft.AspNetCore.ApiAuthorization.IdentityServer 是否支持 PKCE 流程。

哪个包满足我的要求?

我找到了关于 Microsoft 维护的 nuget 功能的讨论,它在四月份提到它 仅支持隐式流.稍后它将支持 PKCE 秘密流程。

https://github.com/aspnet/AspNetCore/issues/5833

IdentityServer4(或者特别是 IdentityServer4.AccessTokenValidation 用于发布 PKCE 密钥)可以是我的主要应用程序的中间件。

所以我会坚持IdentityServer4,因为它符合我的两个要求。