Dotnetplace.com

.NET Articles, Web Devploment, ASP.NET, HTML, Sharepoint 2010, Aamir Hasan
Advertise Here
Advertise Here
Advertise Here
Advertise Here
Advertise Here
Advertise Here
Advertise Here
Advertise Here
Advertise Here

Advertise

Loading...


Posted by Aamir Hasan   on Sunday, September 25, 2011 Total Views:  

Machine key generate a unique key which helps you on single form because it helps to protect your Form Authentication cookies and page level View state. When user send request and Server A received response with form Authentication cookies, now again he send request which was received by Server B and attempted to decrypt form authentication cookies which was unsuccessful to decrypt because server A was using his own unique machine key and server B was using its own unique machine key to decrypt the form Authentication cookies. To avoid this problem use same machine key on all server.


Let’s see the example how to generate machine key for web site.

 

Step 1: Open your IIS Manager from Administrative tool -> Internet Information Services Manager.

Step 2: In Connection pane on left side of window, click on the website.

Step 3: Double click on Machine Key icon as shown below.

You will see Machine key page, default encryption method is SHA1, you can change it from dropdown list as shown.


Step 4: Click on Generate Keys from Actions pane from left side of IIS window as shown.


Step 5: Click Apply as shown.

Step 6: Message will be shown on Alerts pane, "The changes have been successfully saved"

Step 7: Open your Web.Config file, you will find the <machineKey> inside the <system.web> section as shown.

 

<?xmlversion="1.0"encoding="UTF-8"?>
<
configuration>
 
  <system.web>
     
<
machineKeydecryptionKey="43B77C7F7CCC3CDEF3AD3493D520C203D0E4A5D8EFB9FA52"
      validationKey="7225EEAECE4ACD976C7F13D47C4BAC40C88EC24535F9B639D1CBDCB4A342163CCFB6D7B86602F03F77E5A149055E30A11771225ED83D03FB41B01A3E93E921F9" />

  
</
system.web>
</
configuration>

 

Note: Apply this machine key on all web farm servers; this is my generated machine key.

 

Link:

Generate a Machine Key for a Web Farm (IIS 7)

 

Tags:
Category: All | IIS7
Protected by Copyscape Online Plagiarism Tool
Comments are closed
Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5