You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Microsoft.IdentityModel.Tokens/LogMessages.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,7 @@ internal static class LogMessages
142
142
publicconststringIDX10617="IDX10617: Encryption failed. Keywrap is only supported for: '{0}', '{1}' and '{2}'. The content encryption specified is: '{3}'.";
publicconststringIDX10619="IDX10619: Decryption failed. Algorithm: '{0}'. Either the Encryption Algorithm: '{1}' or none of the Security Keys are supported by the CryptoProviderFactory.";
145
-
publicconststringIDX10620="IDX10620: Unable to obtain a CryptoProviderFactory, both EncryptingCredentials.CryptoProviderFactory and EncryptingCredentials.Key.CrypoProviderFactory are null.";
145
+
publicconststringIDX10620="IDX10620: Unable to obtain a CryptoProviderFactory, both EncryptingCredentials.CryptoProviderFactory and EncryptingCredentials.Key.CryptoProviderFactory are null.";
@@ -118,6 +119,7 @@ public TokenValidationParameters()
118
119
RequireSignedTokens=true;
119
120
RequireAudience=true;
120
121
SaveSigninToken=false;
122
+
TryAllDecryptionKeys=true;
121
123
TryAllIssuerSigningKeys=true;
122
124
ValidateActor=false;
123
125
ValidateAudience=true;
@@ -552,10 +554,13 @@ public string RoleClaimType
552
554
/// <summary>
553
555
/// Gets or sets the <see cref="SecurityKey"/> that is to be used for decryption.
554
556
/// </summary>
557
+
/// <remarks>
558
+
/// This <see cref="TokenDecryptionKey"/> will only be used if its <see cref="SecurityKey.KeyId"/> matches the 'kid' parameter in the token.
559
+
/// </remarks>
555
560
publicSecurityKeyTokenDecryptionKey{get;set;}
556
561
557
562
/// <summary>
558
-
/// Gets or sets a delegate that will be called to retreive a <see cref="SecurityKey"/> used for decryption.
563
+
/// Gets or sets a delegate that will be called to retrieve a <see cref="SecurityKey"/> used for decryption.
559
564
/// </summary>
560
565
/// <remarks>
561
566
/// This <see cref="SecurityKey"/> will be used to decrypt the token. This can be helpful when the <see cref="SecurityToken"/> does not contain a key identifier.
@@ -565,6 +570,9 @@ public string RoleClaimType
565
570
/// <summary>
566
571
/// Gets or sets the <see cref="IEnumerable{SecurityKey}"/> that is to be used for decrypting inbound tokens.
567
572
/// </summary>
573
+
/// <remarks>
574
+
/// The decryption keys in this <see cref="TokenDecryptionKeys"/> collection will only be used if their <see cref="SecurityKey.KeyId"/> matches the 'kid' parameter in the token.
/// Gets or sets a value indicating whether all <see cref="IssuerSigningKeys"/> should be tried during signature validation when a key is not matched to token kid or if token kid is empty.
603
+
/// Gets or sets a value indicating whether all <see cref="TokenDecryptionKeys"/> should be tried during token decryption when a key is not matched to token 'kid' or if token 'kid' is empty.
604
+
/// The default is <c>true</c>.
605
+
/// </summary>
606
+
[DefaultValue(true)]
607
+
publicboolTryAllDecryptionKeys{get;set;}
608
+
609
+
/// <summary>
610
+
/// Gets or sets a value indicating whether all <see cref="IssuerSigningKeys"/> should be tried during signature validation when a key is not matched to token 'kid' or if token 'kid' is empty.
@@ -478,6 +480,9 @@ public SignatureValidationDelegate? SignatureValidator
478
480
/// <summary>
479
481
/// Gets the <see cref="IList{T}"/> that is to be used for decrypting inbound tokens.
480
482
/// </summary>
483
+
/// <remarks>
484
+
/// The decryption keys in this <see cref="TokenDecryptionKeys"/> collection will only be used if their <see cref="SecurityKey.KeyId"/> matches the 'kid' parameter in the token.
485
+
/// </remarks>
481
486
publicIList<SecurityKey>TokenDecryptionKeys
482
487
{
483
488
get
@@ -513,6 +518,13 @@ public TokenReplayValidationDelegate TokenReplayValidator
513
518
set{_tokenReplayValidator=value??thrownewArgumentNullException(nameof(value),"TokenReplayValidator cannot be set as null.");}
514
519
}
515
520
521
+
/// <summary>
522
+
/// Gets or sets a value indicating whether all <see cref="TokenDecryptionKeys"/> should be tried during token decryption when a key is not matched to token 'kid' or if token 'kid' is empty.
523
+
/// The default is <c>true</c>.
524
+
/// </summary>
525
+
[DefaultValue(true)]
526
+
publicboolTryAllDecryptionKeys{get;set;}
527
+
516
528
/// <summary>
517
529
/// If the IssuerSigningKeyResolver is unable to resolve the key when validating the signature of the SecurityToken,
0 commit comments