-
Notifications
You must be signed in to change notification settings - Fork 595
[Authorize] http -> https default behaviour? #798
Comments
What authentication middleware are you using? Cookies? OAuth? OIDC? Is the redirect local or remote? When generating local redirects we use the same scheme as the current request. |
I am using Google and and Facebook so I guess OAuth and the following Indentity setup.
Probably misunderstanding the process sorry. |
That seems fine. Please share the rest of your Startup |
|
Seems fine. One other place to check is your x-forwarded-* request headers. Please share the headers for an affected request. |
Nevermind, I was considering a different issue. Try putting this before MVC:
|
That gives a page whose only content is the text http 😄 I did some more testing. I was getting different results with chrome. Any idea what's going on here? |
Huh, that's a new one. Have you been able to repro it since clearing your cache? |
In MVC there's a |
I found this http://stackoverflow.com/questions/9130422/how-long-do-browsers-cache-http-301s Is there a case for requirehttps using a 302? |
When you have |
(Except during development, I suppose.) |
Yes but 301 means preeminent for ever. Perhaps you wanted to allow page in http having previously require https You can't undo that with 301. It's a one way trip. I'd be interested to see what other frameworks do I'll do some research. |
Put it this way [RequireHttps] is an attribute you can add and remove. It's just code after all. It's effect however is permenant and one way. The behaviour of the site can become different to the code. Basically if you use this attribute perhaps by mistake even once you can never go back to the http version. 301 is more about moving entire sites forever. |
I'm moving this to MVC where it belongs now I understand the issue. |
Does [Authorise] always redirect to https?
What I am trying to do is pulish to IIS but debug on plain http kestrel server on dev machine.
Whats the best way of going about this.
I tried using conditional compilation on [RequireHttps] which works but it looks like [Authorize] always try for https.
Obviously in production I am using https. I didn't really want to add https support to kestrel for dev only due to certificate setup and just to keep it simple.
The text was updated successfully, but these errors were encountered: