var roleManager = RoleManager.GetManager("MyProvider");
roleManager.Provider.SuppressSecurityChecks = true;
var userManager = UserManager.GetManager("MyProvider");
userManager.Provider.SuppressSecurityChecks = true;
var roleMembers = roleManager.GetRole("Members");
var roleMembersNoProfile = roleManager.GetRole("MembersNoProfile");
Is there another way to force a refresh of the current user's roles after programmatically updating them? I am working on a sso implementation using STS and hooking into the LoginCompleted event to update the user's roles based on information from the sso identity server.
I got it so that the user's roles do get updated, but they have to do a full logout and log back in cycle before they get "applied." It also appears that during this event the user is not really logged in yet, so I can't try to fire any of the claims manager "refresh" functions.
CustomSFClaimsAuthenticationManager : SFClaimsAuthenticationManager
resourceName, Microsoft.IdentityModel.Claims.IClaimsPrincipal incomingPrincipal)
var principal =
var value = String.Concat(roleId,
Claim(SitefinityClaimTypes.Role, value, ClaimValueTypes.String, issuer, issuer));
Ivan, your code gave me the results I needed as well. The only minor issue is on the backend, when checking roles of a user, the new role isn't listed (but I do gain access to pages). I'm guessing it's using a cached copy. Again, for my purposes it doesn't matter but someone else might need it. It would still be nice to know how to clear the role cache for a particular user w/o restarting the whole site. Thanks