diff --git a/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs b/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs index ea2c58a738..1e65f3ffa8 100644 --- a/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs +++ b/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs @@ -1709,12 +1709,18 @@ public static TheoryData ValidateAudienceTheoryData TestId = "'validateAudience == false, AudienceValidator return false'", SecurityToken = tokenHandler.CreateJwtSecurityToken(issuer: Default.Issuer, audience: Default.Audience), ValidationParameters = ValidateAudienceValidationParameters(null, null, ValidationDelegates.AudienceValidatorReturnsFalse, false), + }, + new JwtTheoryData + { + TestId = "'validAudiences == audiences, validates successfully'", + SecurityToken = tokenHandler.CreateJwtSecurityToken(new SecurityTokenDescriptor{ Issuer = Default.Issuer, Audiences = Default.Audiences}), + ValidationParameters = ValidateAudienceValidationParameters(null, null, null, true, Default.Audiences), } }; } } - private static TokenValidationParameters ValidateAudienceValidationParameters(string validAudience, IEnumerable validAudiences, AudienceValidator audienceValidator, bool validateAudience) + private static TokenValidationParameters ValidateAudienceValidationParameters(string validAudience, IEnumerable validIssuers, AudienceValidator audienceValidator, bool validateAudience, IEnumerable validAudiences = null) { return new TokenValidationParameters { @@ -1724,7 +1730,8 @@ private static TokenValidationParameters ValidateAudienceValidationParameters(st ValidateIssuer = false, ValidateLifetime = false, ValidAudience = validAudience, - ValidIssuers = validAudiences + ValidAudiences = validAudiences, + ValidIssuers = validIssuers }; }