Skip to content

Commit

Permalink
process error for expired cert (#2840) (#2841)
Browse files Browse the repository at this point in the history
  • Loading branch information
westin-m authored May 14, 2024
1 parent 52889d9 commit 2c1414b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Microsoft.Identity.Web.TokenAcquisition/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public static class Constants
internal const string InvalidKeyError = "AADSTS700027";
internal const string SignedAssertionInvalidTimeRange = "AADSTS700024";
internal const string CertificateHasBeenRevoked = "AADSTS7000214";
internal const string CertificateIsOutsideValidityWindow = "AADSTS1000502";
internal const string CiamAuthoritySuffix = ".ciamlogin.com";
internal const string TestSlice = "dc";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,13 @@ private bool IsInvalidClientCertificateOrSignedAssertionError(MsalServiceExcepti
#if !NETSTANDARD2_0 && !NET462 && !NET472
(exMsal.Message.Contains(Constants.InvalidKeyError, StringComparison.OrdinalIgnoreCase)
|| exMsal.Message.Contains(Constants.SignedAssertionInvalidTimeRange, StringComparison.OrdinalIgnoreCase)
|| exMsal.Message.Contains(Constants.CertificateHasBeenRevoked, StringComparison.OrdinalIgnoreCase));
|| exMsal.Message.Contains(Constants.CertificateHasBeenRevoked, StringComparison.OrdinalIgnoreCase)
|| exMsal.Message.Contains(Constants.CertificateIsOutsideValidityWindow, StringComparison.OrdinalIgnoreCase));
#else
(exMsal.Message.Contains(Constants.InvalidKeyError)
|| exMsal.Message.Contains(Constants.SignedAssertionInvalidTimeRange)
|| exMsal.Message.Contains(Constants.CertificateHasBeenRevoked));
|| exMsal.Message.Contains(Constants.CertificateHasBeenRevoked)
|| exMsal.Message.Contains(Constants.CertificateIsOutsideValidityWindow));
#endif
}

Expand Down

0 comments on commit 2c1414b

Please sign in to comment.