-
Notifications
You must be signed in to change notification settings - Fork 351
Middleware does not pass OwinContext.User forward in Pipeline #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @daniefer. Thanks for all the details you've provided. Do you happen to have a small sample project we can use to repro the issue? //cc @danroth27, @rynowak |
Cleaned up the example a bit and made a repo here https://github.com/daniefer/AspWebApiIssueExample. Thanks @mkArtakMSFT for getting this started. |
Any update or ideas @mkArtakMSFT / @danroth27 / @rynowak ? |
@dougbu, do you have any thoughts about this? |
Clearing the WorkaroundThe test application seems to work as expected if I remove the If you need that call, I suggest creating a new message handler ( Potential fixChanging |
Don't need much more investigation. But, I'm leaving the BTW we should change |
Adding |
We discussed this internally and decided two things:
Therefore, we should fix this problem without a fallback to the previous, incorrect behaviour. |
Clearing assignment and |
Thanks for investigation everyone. It is good to hear that I am not losing my mind. Another bit of info that might be useful, I was able to work around this without adding a wrapper around the
Luckily we were already prefixing all our routes with a consistent name so it was a pretty simple transition. |
Reopening, as the actual fix is very cheap too... Better to do it and forget! |
…handlers - #119 nits: use `var` more in affected tests
I am trying to setup a web api with signalr and during the process I noticed this oddity. I cannot seem to find a documented reason why the Identity on the OwinContext would be emptied out after there was no match on the web api route table. I put together a simple project to show this in action:
Startup
Dummy token formatter
Controller
Hub
If I attempt to connect to a Hub (at the end of the pipeline) the OwinContext is no longer authenticated.
The output from each DebugMiddleware shows:
Output
Is this a bug or is there a reason for this maddening quirk?
The text was updated successfully, but these errors were encountered: