How can I compute the value of the ASP.NET forms authentication cookie?
1 Answer
It completely depends on the settings you've chosen. The value of the forms authentication cookie is a FormsAuthenticationTicket. The ticket has a number of properties, and it is then:
- Serialized before further processing.
- At this point it can either be signed (using a message authentication code), or encrypted, or signed and encrypted, or neither.
- If it signed, it could be signed using one of a number of mechanisms as specified in the machine or application configuration.
- If it is encrypted, it will be encrypted using an algorithm and key specified in either the machine or application configuration.
So, you'll have to know which specific configuration you're targeting (and the specific keys, if applicable) in order turn the value of the forms authentication cookie into something usable.