Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Cookie Middleware CookieAuthenticationHandler not redirecting correctly #1070

Closed
h3smith opened this issue Dec 13, 2016 · 2 comments
Closed

Comments

@h3smith
Copy link

h3smith commented Dec 13, 2016

Out solution is sitting behind a load balancer that terminates the SSL connection. .NET Core app just handles the HTTP request.

When this is an SSL connection on a non-standard port https://something:8443, when the redirect occurs, it is pushing to http://something:8443, disregarding the HTTPS scheme.

The CookieAuthenticationHandler is not looking to validate the scheme before performing the redirect on an authentication failure.

@Tratcher
Copy link
Member

Duplicate: #929

@h3smith
Copy link
Author

h3smith commented Dec 13, 2016

For anyone else with the issue,

app.Use((context, next) =>
{
  context.Request.Scheme = "https";
  return next();
});

Fixes the problem. We disable this with an environment variable if we need to use port 80.

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

No branches or pull requests

2 participants