asp.net - OWIN 作为 IdentityServer4 的受众

标签 asp.net owin identityserver4

我的组织使用 IdentityServer4 作为单点登录提供商进行承载身份验证。

我们还有许多使用 .NET Framework 4.6 和 OWIN 编写的服务。在 OWIN Web API 中验证来自 IdentityServer4 的 token 的“正确”方法是什么?

我找到了与 OWIN 一起使用的 NuGet-Package IdentityServer3.AccessTokenValidation。但据我所知,IdentityServer4.AccessTokenValidation 包似乎只适用于 ASP.NET Core。

我是否必须通过 IdentityServerBearerTokenValidationMiddleware 类手动配置验证?或者有更好的解决方案吗?

最佳答案

您可以将 IdentityServer 3 包用于 .NET Framework 4.6 应用程序,而 IdentityServer 4 在 .net 核心上运行。

它们应该是兼容的,我知道这对于 .net core 1.1 是正确的。我还没有尝试过 .net core 2.0。有很多重大更改,但我认为这仍然是可能的。

来自更新的article来自斯科特·布雷迪:

When we integrate a client application with IdentityServer, we are not integrating to an implementation. Instead we are integrating using the OpenID Connect or OAuth specifications. This means any application that currently works with IdentityServer 3 will work with IdentityServer 4.

附带说明:IdentityServer 3 未维护 anymore .但这对于当前的软件包来说应该无关紧要。

关于asp.net - OWIN 作为 IdentityServer4 的受众,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48062678/

相关文章:

html - 如何为具有相同分辨率的不同设备提供相同网址的不同 View ?

asp.net-mvc - 温莎城堡与 owin 和 Identity

identityserver4 - 如何创建 API/IdentityServer/Blazor(服务器端)应用程序?

identityserver4 - 自定义 ASP.NET 标识

c# - 第一次在 ASP.NET 中使用安全性

asp.net - Azure signalR + Azure http 触发器 - 部署时授权错误

owin - OWIN 安全 AuthenticationHandler 中的多个 cookie 问题

c# - .Net 核心 2.2 未将 302 的状态代码更新为 401。OnRedirectToLogin 事件未触发

javascript - 从 WebForms 页面进行 AJAX 调用的最佳方式

c# - 将整个 C# 控制台应用程序打包在一个文件中?