Hello,
I’m using claims authentication as shown here
public bool UserLoggedIn(UserProfile userProfile) { var userCredentials = new[] { new Claim("UserId", Convert.ToString(userProfile.UserId)), new Claim("Username", Convert.ToString(userProfile.Username)), new Claim("Firstname", Convert.ToString(userProfile.Firstname))}; var id = new ClaimsIdentity(userCredentials, "Forms"); var cp = new ClaimsPrincipal(id); var token = new SessionSecurityToken(cp); var sam = FederatedAuthentication.SessionAuthenticationModule; sam.WriteSessionTokenToCookie(token); return true; }
In my site the user has the option to change his name, how can I update the Firstname value inside the above the claims authentication?
Reissue the cookie with the new claims, just like the login page does above.