Skip to content

Commit

Permalink
Reduce the claims contained in the access token (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Oct 17, 2023
1 parent ce4382b commit 2b8fa63
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,13 @@ public async Task<IActionResult> SignOutPost()

private static IEnumerable<string> GetDestinations(Claim claim, ClaimsPrincipal principal)
{
yield return Destinations.AccessToken;

switch (claim.Type)
{
case Claims.Subject:
yield return Destinations.AccessToken;
yield return Destinations.IdentityToken;
yield break;

case Claims.Name:
case Claims.GivenName:
case Claims.MiddleName:
Expand Down Expand Up @@ -483,6 +486,10 @@ private static IEnumerable<string> GetDestinations(Claim claim, ClaimsPrincipal
yield break;

case CustomClaims.Trn:
yield return Destinations.AccessToken;
yield return Destinations.IdentityToken;
yield break;

case CustomClaims.TrnLookupStatus:
case CustomClaims.NiNumber:
case CustomClaims.TrnMatchNiNumber:
Expand Down

0 comments on commit 2b8fa63

Please sign in to comment.