首页 > 解决方案 > 使用 .Net core 2.2 Web API 验证 .Net 4.x 应用程序

问题描述

我正在 .Net Core 2.2 中制作令牌身份验证 Web API,尚未决定是否应该使用 OWIN 或 identityserver4。

在我们的 Intranet 上,我们有许多在 .Net 4.5 中制作的应用程序以及在 .Net Core 2.2 中制作的一些最新应用程序。

是否可以在 .Net Core 2.2 Web API 上对它们进行身份验证?

标签: authenticationwebformsasp.net-core-webapi

解决方案


您可以使用在 .NET Core 2.2 应用程序中运行的 IdentityServer4,它可以为您的所有应用程序提供令牌身份验证。这使用 OAuth2,它将为您提供一个令牌,该令牌可以在对您的 API 的后续 HTTP 请求的 HTTP 请求授权标头中设置。您根本不需要使用 cookie。

https://identityserver4.readthedocs.io/en/latest/intro/big_picture.html


推荐阅读