IsolateApps causes the specified decryption key has invalid hexadecimal characters

I am working on an MVC 4 site that uses authentication. The site requires the values โ€‹โ€‹of the machine key. I did this through the IIS interface, deselecting "automatically generate at run time", generated key values โ€‹โ€‹and selected "generate a unique key for each application"

The web.config tab looks something like this:

<machineKey decryption="DES" decryptionKey="{hex-key value},IsolateApps" validationKey="{hex-key value},IsolateApps" />; 

While this seems to work fine in another web project, this leads to the error "Decimal key with the indicated errors with the errors indicated on the debut machine that I am working on now (in IIS-Express and IIS 7.5) hexadecimal characters ".

Removing ",IsolateApps" from key values โ€‹โ€‹solves the problem, but since I need this option during production, I donโ€™t want to remove it now, only to have this problem when deployed.

What gives? The developer block is a SQL 2008 R2 field with .net 2.0 and .net 4.0.

+48
asp.net-mvc encryption
Feb 21 '13 at 13:03
source share
3 answers

The IsolateApps modifier causes ASP.NET to generate a unique key for each application on your server. This only applies if you get ASP.NET to automatically generate keys at run time.

If you do not get ASP.NET to automatically generate keys and instead specify keys using decryptionKey="{hex-key value}" , then the way to force ASP.NET to use a different key for each application is to simply specify a different key in each Web application .config.

In the IIS configuration GUI, you can create Web.config with an explicit key along with the IsolateApps modifier, which is invalid and, in my opinion, this is an error in the GUI configuration interface.

+110
Mar 14 '13 at 3:44
source share

You can fix the problem by adding the following to the machineKey element (compatMode = "Framework20SP1") in web.config See link

+5
Mar 28 '13 at 12:39 on
source share

This can be fixed by adding the machineKey line to your web.config and specifying your keys as shown below (use your own key, although, of course, this can be easily guessed):

 <configuration> <system.web> <machineKey decryptionKey="0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0" validationKey="0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF00123456789ABCDEF0123456789ABCDEF0123456789ABCDEF00123456789ABCDEF0123456789ABCD" /> </system.web> </configuration> 
+2
Nov 01 '16 at 21:32
source share



All Articles