Skip to content

Commit

Permalink
Add signing key issuer validation test for V2 Authority validating V1…
Browse files Browse the repository at this point in the history
… token
  • Loading branch information
Sruthi Keerthi Rangavajhula (from Dev Box) committed Jun 19, 2024
1 parent b2ff02a commit 17b6cd5
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,19 @@ public static TheoryData<AadSigningKeyIssuerTheoryData> ValidateIssuerSigningKey
OpenIdConnectConfiguration = mockConfiguration
});

jwk = KeyingMaterial.JsonWebKeyP256;
jwk.AdditionalData.Add(OpenIdProviderMetadataNames.Issuer, ValidatorConstants.AadIssuerV2CommonAuthority);
mockConfiguration.JsonWebKeySet.Keys.Add(jwk);
mockConfiguration.Issuer = ValidatorConstants.AadIssuerV2CommonAuthority;
var jwtSecurityTokenV1Issuer = new JwtSecurityToken(issuer: ValidatorConstants.V1Issuer, claims: new[] { issClaim, tidClaim });
theoryData.Add(new AadSigningKeyIssuerTheoryData
{
TestId = "HappyPath_V2AuthorityV1TokenIssuer_Matches_SigningKeyIssuer",
SecurityKey = KeyingMaterial.JsonWebKeyP256,
SecurityToken = jwtSecurityTokenV1Issuer,
OpenIdConnectConfiguration = mockConfiguration
});

theoryData.Add(new AadSigningKeyIssuerTheoryData
{
TestId = "MissingTenantIdClaimInToken",
Expand Down

0 comments on commit 17b6cd5

Please sign in to comment.