Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
log claim types that were filtered from profile service
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Dec 22, 2016
1 parent afb09a6 commit 62eea36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/IdentityServer4/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public class Filters
};

// filter list for claims returned from profile service prior to creating tokens
public static readonly string[] ClaimsProviderFilterClaimTypes = new string[]
public static readonly string[] ClaimsServiceFilterClaimTypes = new string[]
{
// TODO: consider JwtClaimTypes.AuthenticationContextClassReference,
JwtClaimTypes.AccessTokenHash,
Expand Down
8 changes: 7 additions & 1 deletion src/IdentityServer4/Services/DefaultClaimsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,13 @@ protected virtual IEnumerable<Claim> GetOptionalClaims(ClaimsPrincipal subject)
/// <returns></returns>
protected virtual IEnumerable<Claim> FilterProtocolClaims(IEnumerable<Claim> claims)
{
return claims.Where(x => !Constants.Filters.ClaimsProviderFilterClaimTypes.Contains(x.Type));
var claimsToFilter = claims.Where(x => Constants.Filters.ClaimsServiceFilterClaimTypes.Contains(x.Type));
if (claimsToFilter.Any())
{
var types = claimsToFilter.Select(x => x.Type);
_logger.LogInformation("Claim types from profile service that were filtered: {claimTypes}", types);
}
return claims.Except(claimsToFilter);
}
}
}

0 comments on commit 62eea36

Please sign in to comment.