Adding Handler authorization through configuration

In WCF, you can add an authorization policy through web.config using serviceAuthorizationnode in the behavior of the service. Is there any way to enable AuthorizationHandlerin .NET Core WebAPI via config?

To be clear, I am trying to replace this line in Startup.cswith something in the web.config file:

services.AddSingleton<IAuthorizationHandler, MyAuthorizationHandler>();
+4
source share
1 answer

web.config is used only for a specific IIS configuration. Due to the cross-platform nature of .net-core, they have tied the connection to the web configuration to configure the application.

IIS IIS Express web.config. web.config ASP.NET IIS.

ASP.NET: web.config

- , json , / .

, , - , IOptionsSnapshot
ASP.NET Core 1.1 .

IOptionsSnapshot . ASP.NET Core 1.1 IOptionsSnapshot IOptionsMonitor<TOptions> , . ASP.NET Core 2.0 .

.

+2

Source: https://habr.com/ru/post/1692711/


All Articles