Skip to content

Instantly share code, notes, and snippets.

@benfoster
Created March 7, 2014 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benfoster/9412542 to your computer and use it in GitHub Desktop.
Save benfoster/9412542 to your computer and use it in GitHub Desktop.
Refreshing claims using ASP.NET Identity Cooke based AuthN
public static class AuthenticationManagerExtensions
{
public static void RefreshUserClaims(
this IAuthenticationManager authManager,
IEnumerable<Claim> updatedClaims,
string authenticationType)
{
var identity = new ClaimsIdentity(updatedClaims, authenticationType);
authManager.SignOut(authenticationType);
authManager.SignIn(identity);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment