fix #4580 - add logout everywhere support using SecurityStamp

This commit is contained in:
sbwalker
2024-09-17 08:45:27 -04:00
parent 1f2e2148d5
commit 48f2079f88
13 changed files with 242 additions and 216 deletions

View File

@ -99,8 +99,8 @@ namespace Oqtane.Security
if (alias != null && user != null && !user.IsDeleted)
{
identity.AddClaim(new Claim(ClaimTypes.Name, user.Username));
identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, user.UserId.ToString()));
identity.AddClaim(new Claim("sitekey", alias.SiteKey));
identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, user.UserId.ToString()));
identity.AddClaim(new Claim(Constants.SiteKeyClaimType, alias.SiteKey));
if (user.Roles.Contains(RoleNames.Host))
{
// host users are site admins by default
@ -115,6 +115,7 @@ namespace Oqtane.Security
identity.AddClaim(new Claim(ClaimTypes.Role, role));
}
}
identity.AddClaim(new Claim(Constants.SecurityStampClaimType, user.SecurityStamp));
}
return identity;
}