tags:

views:

27

answers:

3

How i can implement https login in asp.net and C#

A: 

The same way you do for the "regular" login. You only have to enable SSL in IIS. For this you will need a server certificate. Read This And This

Sergio
+1  A: 

Hi THOmas,

I'm assuming you your ok with a normal login page. So for ssl buy your certificate and install http://www.instantssl.com/ssl-certificate-support/cert_installation/iis_ssl_certificate_5x.html

Then make sure you login page redirects to https rather than http.

        if (!Request.IsSecureConnection)
        {
            Response.Redirect(Request.Url.AbsoluteUri.ToLower().Replace("http", "https"), true);
        }
Tigger
A: 

As with all things .net, first check out what The Gu has to say: Protected ASP.Net Site in 24 lines of code. That should cover the basics of creating a protected site.

In order to protect the page with SSL, you will need a server certificate. Installing one with IIS is covered here: IIS 5/6 and IIS 7. Some specifics of how to secure ASP.Net in this manner are covered here. Dominick Baier's blog is also always a good source of info on .net security matters, and he has an old post on partially-SSL secured ASP.Net sites here that could be helpful depending upon the requirements you are working with.

Jeffrey Meyer