Friday, March 12, 2010

Sharing an Encrypted Authentication Ticket Between ASP.NET 1.1 and ASP.NET 2.0 (or higher)

Thank you to Dan Sellers's WebLog for this little tidbit regarding sharing an encrypted Authentication ticket between a .NET 1.1 application and .NET 2.0 (or higher). I am posting it here more for my benefit as it seems I've been doing this a lot lately. You can read up on the details on his site, but the important bit is that the first machine key section goes in the .net 1.1 app and the second one goes in the .net 2.0 or higher app. Poof. Magic. Like anything else, really simple if you know how to do it. Hope this helps.


Snippet of the machine config for an ASP.NET 1.1 Application:


<machineKey
validationKey='5C9D7A8F3E336275166075E596F19EB9B478F771C7FE45B65BF6E9B41BA9575F04672CCC4242B2245200CD0E63A8991CA6BFB2D77FE9C5B0D69889359574C5F3'
decryptionKey='AF96F355CEC57EFD2F996515BF465DD399FAF7B806B2CD55' validation='SHA1'/>

Snippet of Web Config for an ASP.NET 2.0 Application with decryption attribute specified:


<system.web>
<machineKey
validationKey='5C9D7A8F3E336275166075E596F19EB9B478F771C7FE45B65BF6E9B41BA9575F04672CCC4242B2245200CD0E63A8991CA6BFB2D77FE9C5B0D69889359574C5F3'
decryptionKey='AF96F355CEC57EFD2F996515BF465DD399FAF7B806B2CD55'
validation='SHA1' decryption='3DES' />