ASP.NET Web API Self-Host with Windows Authentication

前端 未结 9 1300
不知归路
不知归路 2021-01-30 11:31

I am trying to use the ASP.NET Web API Self-Host option with Windows authentication so I can determine the logged on user and ultimately accept or reject the user based on their

9条回答
  •  無奈伤痛
    2021-01-30 12:06

    I am a little late to this. However, if you are using Owin to self host and need windows auth. In your startup class you can add the following.

    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            HttpListener listener = (HttpListener)app.Properties["System.Net.HttpListener"];
            listener.AuthenticationSchemes = AuthenticationSchemes.IntegratedWindowsAuthentication;
        }
    }
    

提交回复
热议问题