johnny 5
johnny 5

Reputation: 20997

How to decrypt Authentication Cookie From Javascript

Say I have some Form's authentication Cookie:

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
  "TESTTEST",
  DateTime.Now,
  DateTime.Now.AddMinutes(30),
  false,
  String.Empty,
  FormsAuthentication.FormsCookiePath);

Normally in C# we can decrypt this like so:

var authToken = FormsAuthentication.Decrypt(authCookie.Value);

I'm creating a tool for testing an I want to decrypt the cookie on the client-side.

If my machine key is: GHFDK45sDFGSKj234 How can I decrypt the Authentication from Javascript?

Upvotes: 1

Views: 2701

Answers (1)

Callback Kid
Callback Kid

Reputation: 718

First you need to know the algorithm that the forms authentication is using. Then you need to find a javascript library that can decrypt that algorithm

Upvotes: 1

Related Questions