In order to debug a production issue, I need a tool to decrypt an authentication cookie. I wrote a quick script to decrypt it using FormAuthentication.The essence is
FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(source.Text);
The server has machineKey set and I am using the same key in this app. I am getting cookie text using Fiddler. However, I always get Unable to Validation Exception when using FormAuthentication.Decrypt. The cookie is set HttpOnly.
Am I missing something?
Note: There were a number similar questions but none of the answer has so far helped me so decided to post a new one.
It seems to be related to the machine or some sort of machine related identifier. When I ran the sample script on the same server as the production server (i.e where the cookie was generated). The decryption works fine. I still haven’t delve deep into finding out why so but a quick reflection of
tells that Unable_to_validate_data is thrown for pretty much any exception there.