Skip to content
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

ASP.Net Identity - Not authenticated does'nt honour special headers #39

Open
johnkattenhorn opened this issue Sep 10, 2016 · 2 comments

Comments

@johnkattenhorn
Copy link

It's take me a couple of days to figure out what our problem was, we host a ASP.NET Core Web App behind the gateway, this worked great until we secured the home page.

Once we secured the home page, the redirect request to the login page doesn't seem to use the special headers (which by the way I can't see in fiddle / chrome - should we ? ).

I'm think the ASP.NET Core Authentication Filter runs first before the middleware has a chance to modify the response.

I looking for some suggestions on how best to approach writing a custom component which would look for and honour the special headers ?

I'm currently studying the ASP.NET Core documentation but the only examples I've turned up so far are related to security policy customisation rather than custom behaviour.

@weidazhao
Copy link
Owner

@johnkattenhorn You usually can register your own middlewares and adjust the orders in Startup.Configure(). If you need to register a middleware that has to run as the first in the pipeline, you could register it with IStartupFilter. I used the same mechanism in the Service Fabric Hosting component: https://github.com/weidazhao/Hosting/blob/master/Microsoft.ServiceFabric.AspNetCore.Hosting/Internal/ServiceFabricStartupFilter.cs.

Let me know if this helps.

@johnkattenhorn
Copy link
Author

johnkattenhorn commented Sep 12, 2016

Ok thanks, IStartup Filter might be useful as I put together a simple middleware together but it had no effect, the ASP.NET Identity stuff jumped in first and therefore didn’t hit the middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants