Setting Up the Machine Key Using IIS Manager Print

  • 445

Easy Way

If you have access to the IIS management console for the server where your .NET Application is installed, it is the easiest way to setup a machine key.

Start the management console and then select the web site. Open the machine key configuration:

IIS Machine Key Setup

The machine key control panel has the following settings:
IIS Machine Key Generate

Uncheck "Automatically generate at runtime" for both the validation key and the decryption key.

Click "Generate Keys" under "Actions" on the right side of the panel.

Click "Apply".

IIS Machine Key Generate

Setting Up the Machine Key Directly in the Web.config File

If you do not have access to the IIS management console, it is still possible to set-up a machine key for an Orchard application.

To do so, open the web.config file that is at the root of the Orchard web site. The machine key settings can be found or created under configuration/system.web:

<configuration>
  <system.web>
    <machineKey decryptionKey="Decryption key goes here,IsolateApps" 
                validationKey="Validation key goes here,IsolateApps" />
  </system.web>
</configuration>

To create the keys that go into the placeholders above, you can use one of the available online generators, such as: https://chaos.aspnet.cz/


Was this answer helpful?

« Back