I am attempting to add custom claims to my FomsIdentity class instance after logging in through Forms Authentication in ASP.NET MVC.
However, when I attempt to retrieve my Claims back from another controller, I am only getting a single Claim back stored with my FormsIdentity!
This is how I am attaching Claims:
private void SignIn(string userName, int expirationTime)
{
// Clear any lingering authentication data
FormsAuthentication.SignOut();
//Create a new Forms Authentication Ticket
FormsAuthenticationTicket newAuthTicket = new FormsAuthenticationTicket(userName, true, expirationTime);
//Create the FormsIdentity object
FormsIdentity formsIdentity = new FormsIdentity(newAuthTicket);
List<Claim> claims = new List<Claim>();
claims.Add(new Claim(ClaimTypes.Name, userName));
claims.Add ...
Go to the complete details ...