diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs index 39453421ef..8b4a22b584 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs @@ -9,7 +9,12 @@ namespace Volo.Abp.IdentityServer.IdentityResources protected IdentityClaim() { - + + } + + public virtual bool Equals(Guid identityResourceId, [NotNull] string type) + { + return IdentityResourceId == identityResourceId && Type == type; } protected internal IdentityClaim(Guid identityResourceId, [NotNull] string type) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs index 37b259fe61..9ecaa42741 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using JetBrains.Annotations; using Volo.Abp.Domain.Entities; @@ -61,5 +62,15 @@ namespace Volo.Abp.IdentityServer.IdentityResources { UserClaims.Clear(); } + + public virtual void RemoveUserClaim(string type) + { + UserClaims.RemoveAll(c => c.Type == type); + } + + public virtual IdentityClaim FindUserClaim(string type) + { + return UserClaims.FirstOrDefault(c => c.Type == type); + } } }