Wednesday, December 17, 2014

Generate MachineKey in IIS 7.0+

Normally machineKey is already configured in your machine.config file which is applied to all your application if you are working in the same Web Farm. But most of the time this may not be the scenario, it may be possible that your applications are distributed across different Web Farms.

To deal with this all you need is to configure the same decryption keys in web.config of all the applications to decrypt the authentication cookie created at client side.

To generate a new machine key all you need is to first open the IIS Admin Console, and

1. Select the Server

2. Select the Machine Key from right hand side of the console

image

3. Double Click to open the Machine Key and then Select ‘Generate Keys’ from Actions

image

4. You got the Decryption Key and Unique Key

You can use this Keys in you web.config file which might look similar to something like

image

0 comments:

Post a Comment