diff --git a/test/Microsoft.IdentityModel.Validators.Tests/AadIssuerValidatorTests.cs b/test/Microsoft.IdentityModel.Validators.Tests/AadIssuerValidatorTests.cs index cbaed13128..8d29911c8c 100644 --- a/test/Microsoft.IdentityModel.Validators.Tests/AadIssuerValidatorTests.cs +++ b/test/Microsoft.IdentityModel.Validators.Tests/AadIssuerValidatorTests.cs @@ -50,6 +50,27 @@ public static TheoryData AadIssuerValidationTestCa TenantIdClaim = ValidatorConstants.TenantIdAsGuid, ExpectedResult = true, }, + new AadIssuerValidatorTheoryData("ValidateIssuer_V11TemplateWithV11Issuer_Success") + { + TemplatedIssuer = ValidatorConstants.AadIssuerV11CommonAuthority, + TokenIssuer = ValidatorConstants.AadIssuerV11, + TenantIdClaim = ValidatorConstants.TenantIdAsGuid, + ExpectedResult = true, + }, + new AadIssuerValidatorTheoryData("ValidateIssuer_V11TemplateWithV1Issuer_Failure") + { + TemplatedIssuer = ValidatorConstants.AadIssuerV11CommonAuthority, + TokenIssuer = ValidatorConstants.V1Issuer, + TenantIdClaim = ValidatorConstants.TenantIdAsGuid, + ExpectedResult = false, + }, + new AadIssuerValidatorTheoryData("ValidateIssuer_V11TemplateWithV2Issuer_Failure") + { + TemplatedIssuer = ValidatorConstants.AadIssuerV11CommonAuthority, + TokenIssuer = ValidatorConstants.AadIssuer, + TenantIdClaim = ValidatorConstants.TenantIdAsGuid, + ExpectedResult = false, + }, new AadIssuerValidatorTheoryData("ValidateIssuer_NullTemplate_Failure") { TemplatedIssuer = ValidatorConstants.AadIssuerV1CommonAuthority, @@ -57,7 +78,6 @@ public static TheoryData AadIssuerValidationTestCa TenantIdClaim = ValidatorConstants.TenantIdAsGuid, ExpectedResult = false, }, - new AadIssuerValidatorTheoryData("ValidateIssuer_NullIssuer_Failure") { TemplatedIssuer = ValidatorConstants.AadIssuerV1CommonAuthority, @@ -99,7 +119,14 @@ public static TheoryData AadIssuerValidationTestCa TokenIssuer = "https://login.microsoftonline.com/{tenantid}/v2.0", TenantIdClaim = ValidatorConstants.TenantIdAsGuid, ExpectedResult = false, - } + }, + new AadIssuerValidatorTheoryData("ValidateIssuerSigningKey_MalformedV2TokenIssuer_Failure") + { + TemplatedIssuer = ValidatorConstants.AadIssuerV2CommonAuthority, + TokenIssuer = "https://login.microsoftonline.com/{tenantid}/v2.0", + TenantIdClaim = ValidatorConstants.TenantIdAsGuid, + ExpectedResult = false, + }, }; return theoryData;