@@ -3446,7 +3446,9 @@ public void JWECompressionTest(CreateTokenTheoryData theoryData)
3446
3446
try
3447
3447
{
3448
3448
var handler = new JsonWebTokenHandler ( ) ;
3449
- CompressionProviderFactory . Default = theoryData . CompressionProviderFactory ;
3449
+ // We need to have a replacement model for custom compression
3450
+ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2719954
3451
+ //CompressionProviderFactory.Default = theoryData.CompressionProviderFactory;
3450
3452
string jwtToken ;
3451
3453
if ( theoryData . SigningCredentials == null )
3452
3454
jwtToken = handler . CreateToken ( theoryData . Payload , theoryData . EncryptingCredentials , theoryData . CompressionAlgorithm ) ;
@@ -3524,17 +3526,20 @@ public static TheoryData<CreateTokenTheoryData> JWECompressionTheoryData
3524
3526
EncryptingCredentials = new EncryptingCredentials ( KeyingMaterial . DefaultX509Key_2048 , SecurityAlgorithms . RsaPKCS1 , SecurityAlgorithms . Aes128CbcHmacSha256 ) ,
3525
3527
ExpectedException = new ExpectedException ( typeof ( SecurityTokenCompressionFailedException ) , "IDX10680:" , typeof ( NotSupportedException ) )
3526
3528
} ,
3527
- new CreateTokenTheoryData ( )
3528
- {
3529
- TestId = "NullCompressionProviderFactory" ,
3530
- CompressionAlgorithm = CompressionAlgorithms . Deflate ,
3531
- CompressionProviderFactory = null ,
3532
- ValidationParameters = Default . JWECompressionTokenValidationParameters ,
3533
- Payload = Default . PayloadString ,
3534
- SigningCredentials = KeyingMaterial . DefaultSymmetricSigningCreds_256_Sha2 ,
3535
- EncryptingCredentials = new EncryptingCredentials ( KeyingMaterial . DefaultX509Key_2048 , SecurityAlgorithms . RsaPKCS1 , SecurityAlgorithms . Aes128CbcHmacSha256 ) ,
3536
- ExpectedException = ExpectedException . ArgumentNullException ( "IDX10000:" )
3537
- } ,
3529
+ // Skip these tests as they set a static
3530
+ // We need to have a replacement model for custom compression
3531
+ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2719954
3532
+ //new CreateTokenTheoryData()
3533
+ //{
3534
+ // TestId = "NullCompressionProviderFactory",
3535
+ // CompressionAlgorithm = CompressionAlgorithms.Deflate,
3536
+ // CompressionProviderFactory = null,
3537
+ // ValidationParameters = Default.JWECompressionTokenValidationParameters,
3538
+ // Payload = Default.PayloadString,
3539
+ // SigningCredentials = KeyingMaterial.DefaultSymmetricSigningCreds_256_Sha2,
3540
+ // EncryptingCredentials = new EncryptingCredentials(KeyingMaterial.DefaultX509Key_2048, SecurityAlgorithms.RsaPKCS1, SecurityAlgorithms.Aes128CbcHmacSha256),
3541
+ // ExpectedException = ExpectedException.ArgumentNullException("IDX10000:")
3542
+ //},
3538
3543
new CreateTokenTheoryData ( )
3539
3544
{
3540
3545
TestId = "NullSigningCredentialsRequireSignedTokensFalse" ,
@@ -3554,27 +3559,30 @@ public static TheoryData<CreateTokenTheoryData> JWECompressionTheoryData
3554
3559
EncryptingCredentials = new EncryptingCredentials ( KeyingMaterial . DefaultX509Key_2048 , SecurityAlgorithms . RsaPKCS1 , SecurityAlgorithms . Aes128CbcHmacSha256 ) ,
3555
3560
ExpectedException = ExpectedException . SecurityTokenInvalidSignatureException ( "IDX10504:" )
3556
3561
} ,
3557
- new CreateTokenTheoryData ( )
3558
- {
3559
- TestId = "CustomCompressProviderSucceeds" ,
3560
- CompressionAlgorithm = CompressionAlgorithms . Deflate ,
3561
- CompressionProviderFactory = compressionProviderFactoryForCustom ,
3562
- ValidationParameters = Default . JWECompressionTokenValidationParameters ,
3563
- Payload = Default . PayloadString ,
3564
- SigningCredentials = KeyingMaterial . DefaultSymmetricSigningCreds_256_Sha2 ,
3565
- EncryptingCredentials = new EncryptingCredentials ( KeyingMaterial . DefaultX509Key_2048 , SecurityAlgorithms . RsaPKCS1 , SecurityAlgorithms . Aes128CbcHmacSha256 ) ,
3566
- } ,
3567
- new CreateTokenTheoryData ( )
3568
- {
3569
- TestId = "CustomCompressionProviderFails" ,
3570
- CompressionAlgorithm = CompressionAlgorithms . Deflate ,
3571
- CompressionProviderFactory = compressionProviderFactoryForCustom2 ,
3572
- ValidationParameters = Default . JWECompressionTokenValidationParameters ,
3573
- Payload = Default . PayloadString ,
3574
- SigningCredentials = KeyingMaterial . DefaultSymmetricSigningCreds_256_Sha2 ,
3575
- EncryptingCredentials = new EncryptingCredentials ( KeyingMaterial . DefaultX509Key_2048 , SecurityAlgorithms . RsaPKCS1 , SecurityAlgorithms . Aes128CbcHmacSha256 ) ,
3576
- ExpectedException = new ExpectedException ( typeof ( SecurityTokenCompressionFailedException ) , "IDX10680:" , typeof ( InvalidOperationException ) )
3577
- } ,
3562
+ // Skip these tests as they set a static
3563
+ // We need to have a replacement model for custom compression
3564
+ // https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2719954
3565
+ //new CreateTokenTheoryData()
3566
+ //{
3567
+ // TestId = "CustomCompressProviderSucceeds",
3568
+ // CompressionAlgorithm = CompressionAlgorithms.Deflate,
3569
+ // CompressionProviderFactory = compressionProviderFactoryForCustom,
3570
+ // ValidationParameters = Default.JWECompressionTokenValidationParameters,
3571
+ // Payload = Default.PayloadString,
3572
+ // SigningCredentials = KeyingMaterial.DefaultSymmetricSigningCreds_256_Sha2,
3573
+ // EncryptingCredentials = new EncryptingCredentials(KeyingMaterial.DefaultX509Key_2048, SecurityAlgorithms.RsaPKCS1, SecurityAlgorithms.Aes128CbcHmacSha256),
3574
+ //},
3575
+ //new CreateTokenTheoryData()
3576
+ //{
3577
+ // TestId = "CustomCompressionProviderFails",
3578
+ // CompressionAlgorithm = CompressionAlgorithms.Deflate,
3579
+ // CompressionProviderFactory = compressionProviderFactoryForCustom2,
3580
+ // ValidationParameters = Default.JWECompressionTokenValidationParameters,
3581
+ // Payload = Default.PayloadString,
3582
+ // SigningCredentials = KeyingMaterial.DefaultSymmetricSigningCreds_256_Sha2,
3583
+ // EncryptingCredentials = new EncryptingCredentials(KeyingMaterial.DefaultX509Key_2048, SecurityAlgorithms.RsaPKCS1, SecurityAlgorithms.Aes128CbcHmacSha256),
3584
+ // ExpectedException = new ExpectedException(typeof(SecurityTokenCompressionFailedException), "IDX10680:", typeof(InvalidOperationException))
3585
+ //},
3578
3586
} ;
3579
3587
}
3580
3588
}
0 commit comments