Skip to content

Commit

Permalink
adjusted logic to use local var since ICollection can't return last i…
Browse files Browse the repository at this point in the history
…tem without iterating through the entire collection
  • Loading branch information
JoshLozensky committed Jun 21, 2024
1 parent 40edbce commit 6044404
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,10 @@ protected virtual Saml2Conditions CreateConditions(SecurityTokenDescriptor token

if (tokenDescriptor.Audiences.Count > 0)
{
conditions.AudienceRestrictions.Add(new Saml2AudienceRestriction(tokenDescriptor.Audiences));
var audienceRestriction = new Saml2AudienceRestriction(tokenDescriptor.Audiences);
if (!string.IsNullOrEmpty(tokenDescriptor.Audience))
conditions.AudienceRestrictions.Add(new Saml2AudienceRestriction(tokenDescriptor.Audience));
audienceRestriction.Audiences.Add(tokenDescriptor.Audience);
conditions.AudienceRestrictions.Add(audienceRestriction);
}
else if (!string.IsNullOrEmpty(tokenDescriptor.Audience))
conditions.AudienceRestrictions.Add(new Saml2AudienceRestriction(tokenDescriptor.Audience));
Expand Down

0 comments on commit 6044404

Please sign in to comment.