MVC - Mixed Auth - OWIN + Windows Auth

后端 未结 2 1550
南旧
南旧 2020-12-13 07:15

I need to have both windows authentication and owin (forms) authentication but i can\'t get it to work.

Probably the best option is to have two sites that have diffe

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 07:56

    I didn't see this in your answer, so for anyone looking on how to capture Windows Auth in your Owin pipeline, you also can add the following to your ConfigureAuth method:

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

提交回复
热议问题