mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
831 B
28 lines
831 B
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Security.Claims;
|
|
using IdentityServer4.Services;
|
|
using Microsoft.Extensions.Logging;
|
|
using Volo.Abp.Security.Claims;
|
|
|
|
namespace Volo.Abp.IdentityServer
|
|
{
|
|
public class AbpClaimsService : DefaultClaimsService
|
|
{
|
|
public AbpClaimsService(IProfileService profile, ILogger<DefaultClaimsService> logger)
|
|
: base(profile, logger)
|
|
{
|
|
}
|
|
|
|
protected override IEnumerable<Claim> GetOptionalClaims(ClaimsPrincipal subject)
|
|
{
|
|
var tenantClaim = subject.FindFirst(AbpClaimTypes.TenantId);
|
|
if (tenantClaim == null)
|
|
{
|
|
return base.GetOptionalClaims(subject);
|
|
}
|
|
|
|
return base.GetOptionalClaims(subject).Union(new[] { tenantClaim });
|
|
}
|
|
}
|
|
}
|
|
|