Open mikdav opened 6 years ago
Committed possible change in d7e95757c2e9d2f9fa60505e02f95381cf414cf7
Verified that I can now use MS Auth middlewares and all unit tests pass.
This is really great! If you're willing to submit a Pull Request, I'll accept it right away!
Have you had a chance to look at dbd5a6460cda1ecc2256388ba9aca408cc42660c that fixes #8? I know it is a bit heavier change because it takes a new dependency on Microsoft.Owin and ups the framework version. However, I needed webapi before I needed the auth, so I committed it first. Just need to know whether you want a pull request for both or if I need to branch. Thanks.
I don't mind taking a dependency on Microsoft.Owin, but it upping the framework version really necessary?
Unfortunately the last version of Microsoft.Owin that supported .Net 4 was 2.1.0 which is more than 4 years old and two major versions ago. Everything since then has required .Net 4.5. So, don't need to go all the way to 4.62, but probably should at least consider 4.5. I have not tested my changes with Microsoft.Owin 2.1.0.
Sorry for taking so long to respond, I thought I already had replied to this. I don't believe requiring .NET 4.5 would be a problem at this point. What do you think?
Wired up a test application with UseActiveDirectoryFederationServicesBearerAuthentication, and get the following exception:
System.NotSupportedException: The OWIN key 'server.OnSendingHeaders' is not available for this request. at Microsoft.Owin.OwinResponse.OnSendingHeaders(Actiond0.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.NotSupportedException: The OWIN key 'server.OnSendingHeaders' is not available for this request.
at Microsoft.Owin.OwinResponse.OnSendingHeaders(Action`1 callback, Object state)
at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.d 0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---d__0.MoveNext()
1 callback, Object state) at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.<BaseInitializeAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware
1.at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.
The FosRequest class would need to be able to handle the common key server.OnSendingHeaders (defined here: http://owin.org/spec/spec/CommonKeys.html#_6._Common_keys) in order to use these middlewares.