OWIN API- .NET核心问题的UseidentityServerauthentication



是否可以配置旧的OWIN WebAPI项目使用IdentityServer4?

在Owin startup.cs文件中,有一个 iAppbuilder app对象,但是useIdentityServerAuthentication扩展方法需要一个 iapplicationBuilder app。这似乎是.NET Core和Owin之间的区别。

如何获得使用IndesserityServerauthentication与旧的iAppbuilder合作?

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        // Obviously this won't work. I added this to help explain the issue.
        IApplicationBuilder app2 = (IApplicationBuilder)app;
        app2.UseIdentityServerAuthentication(
         new IdentityServerAuthenticationOptions()
         {
             Authority = "http://localhost:8080",
             RequireHttpsMetadata = false,
             ApiName =" apiName"
         });
    }
}

此回购显示了katana/owin和asp.net core core apis 使用的几个身份服务器3和4的排列

https://github.com/indistityserver/crossversioneintegrationTests

这具有您需要的一切。

相关内容

  • 没有找到相关文章

最新更新