Wednesday, 28 August 2013

ASP.NET MVC 4 - How to setup HTTPS secured webpage

ASP.NET MVC 4 - How to setup HTTPS secured webpage

I'am writing a web application (ASP.NET MVC4) which has a view to insert
some sensitive user information (not specifically username and password).
I want to secure this screen with the HTTPS protocol and want to store
this information in a secured cookie. First i want to set it up in my
ASP.NET development server of visual studio, afterwards i want to deploy
to azure websites.
I have decorated my controller action with "[RequireHttps]" keyword.
[RequireHttps]
public ActionResult BlobSettings()
{
ViewBag.Message = "Settings";
return View();
}
I have also enabled SSL in my project settings of visual studio. Now two
instances are created in IIS Express (HTTP and HTTPS). When i open HTTPS
url, my whole website is running with the HTTPS Protocol.Not really bad,
but i thought to work with HTTP and HTTPS pages (the other pages should
not be secured).
So my fist question is how can you setup project to work with HTTP and
HTTPS pages and how should you test it with ASP.net developer server?

No comments:

Post a Comment