Attempting to implement OWIN win authentication

I am new to OWIN/C# so I apologize for my ignorance.

I have an existing webapp currently using password grant_type via OWIN.

I have implemented winAuthentication and written a webApi controller to return details via HttpContext to my webApp for testing purposes/learning... I am attempting to apply the same concept to OWIN via HttpListener in the answer here WebApi with OWIN SelfHost and Windows Authentication

I am receiving the following error and wondering if someone could possibly point me in the right direction to understand what I am missing.

The given key was not present in the dictionary.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

Source Error:

Line 37: public void ConfigureOAuth(IAppBuilder app)

Line 38: {

Line 39: var listener = (HttpListener)app.Properties["System.Net.HttpListener"];

Line 40: listener.AuthenticationSchemes = AuthenticationSchemes.IntegratedWindowsAuthentication;


如果我通过IIS托管我的API,看起来我不能使用HttpListener。

链接地址: http://www.djcxy.com/p/95106.html

上一篇: 如何在信号中心获得Owin身份

下一篇: 试图实现OWIN win认证