Cookie revalidation
This commit is contained in:
@@ -36,9 +36,17 @@ public sealed class AdminRoleClaimsTransformation : IClaimsTransformation
|
||||
return principal;
|
||||
}
|
||||
|
||||
if (identity.Claims.Any(c => c.Type == ClaimTypes.Role && c.Value == AuthRoles.Admin))
|
||||
// Remove locally-issued admin role claims so revocations in DB/config take effect immediately.
|
||||
var localAdminClaims = identity.Claims
|
||||
.Where(c =>
|
||||
c.Type == ClaimTypes.Role &&
|
||||
c.Value == AuthRoles.Admin &&
|
||||
string.Equals(c.Issuer, ClaimsIdentity.DefaultIssuer, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
|
||||
foreach (var claim in localAdminClaims)
|
||||
{
|
||||
return principal;
|
||||
identity.RemoveClaim(claim);
|
||||
}
|
||||
|
||||
var configuredGroups = (_configuration[AuthEnvironment.AdminGroups] ?? string.Empty)
|
||||
|
||||
Reference in New Issue
Block a user