This project is read-only.
Project Description
It is generic class to generate the Authentication Token for authentication.
It uses TripleDES encryption.

1. Only accepts primitive data types with nullable and DateTime.
2. While parsing, value of nullable is not found in token then it assigns the default valu

For more detail, please see the attached sample in source.

1. Create Class which has public properties used for generating Authentication Token.
e.g. public class AuthenticationTokenTest
public string Name{get;set;}
public int? Id { get; set; }
public double Price { get; set; }
public DateTime CreateDate{get;set;}
public int? NullableValue{get;set;}
public Guid SystemId { get; set; }

2. Use "Generate" method to generate the encrypted token,
string encryptedToken=AuthenticationToken.AuthenticationToken.Generate<<Type>>(<object>, <Encryption Key>);
In our case, it should be like,
string encryptedToken= AuthenticationToken.AuthenticationToken.Generate<AuthenticationTokenTest>(tokenValues, "z1Av@zy");
3. Use "Parse" method to decrypt the token
AuthenticationToken.AuthenticationToken.Parse<<Type>>(ref tokenValues, <Encrypted Token>, <Encryption Key>);
In our case, it should be like,
AuthenticationToken.AuthenticationToken.Parse<AuthenticationTokenTest>(ref tokenValues, encryptedToken, "z1Av@zy");
and all the values are available in "tokenValues" object.

Last edited Dec 2, 2009 at 7:22 AM by karticles, version 4