简体   繁体   English

Asp.Net Core和WIF配置

[英]Asp.Net Core and WIF configuration

I am beginning to dabble with converting several web apps over to Asp.Net Core. 我开始涉足将几个Web应用程序转换为Asp.Net Core。 I started by creating a website with one page and installed it on the server and then I realized that you needed a shim to get it working with IIS. 我开始创建一个包含一个页面的网站并将其安装在服务器上,然后我意识到你需要一个垫片才能让它与IIS一起工作。 Fine, everything installed and working. 很好,一切安装和工作。

Now, I want to take that controller and require authentication to access it. 现在,我想采用该控制器并要求身份验证来访问它。 I've implemented a custom STS for authenticating users and I'd like to use it for authentication in my Asp.Net Core app. 我已经实现了一个用于验证用户身份的自定义STS,我想在我的Asp.Net Core应用程序中使用它进行身份验证。 This STS creates a JWT and in my other applications I utilize WIF. 这个STS创建了一个JWT,在我的其他应用程序中我使用了WIF。

I don't understand how to configure the Asp.net Core application to enable it to take advantage of WIF. 我不明白如何配置Asp.net Core应用程序以使其能够利用WIF。 Today, in my Asp.Net MVC apps I add in a line in Application_Start: 今天,在我的Asp.Net MVC应用程序中,我在Application_Start中添加一行:

FederatedAuthentication.FederationConfigurationCreated += FederatedAuthenticationOnFederationConfigurationCreated;

In that event handler, I set the FederationConfigurationCreateEventArgs to the relevant WIF configuration. 在该事件处理程序中,我将FederationConfigurationCreateEventArgs设置为相关的WIF配置。

What I don't understand now is how this works in the new world. 我现在不明白的是这在新世界中是如何运作的。 I don't mind having a dependency on the .NET Framwork vs. .NET Core. 我不介意依赖于.NET Framwork与.NET Core。 I just have no idea where to start in terms of getting my Asp.Net Core web app to get its authentication from an STS. 我只是不知道从哪里开始获取我的Asp.Net Core Web应用程序以从STS获得其身份验证。

Any ideas about how to get WIF working in Asp.Net Core? 有关如何在Asp.Net Core中使用WIF的任何想法?

AFAIK Asp.NET Core doesn't work with configuration the way WIF used to work. AFAIK Asp.NET Core无法像WIF一样工作。 IN ASP.NET core you have to configure your security by registering the correct things in the pipeline. 在ASP.NET核心中,您必须通过在管道中注册正确的东西来配置您的安全性。 This example will give you an idea : 这个例子会给你一个想法:

WS-Federation sign-in Asp.NET 5 MVC 6 ADFS WS-Federation登录Asp.NET 5 MVC 6 ADFS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM