Skip to content

[Feature Request] When ESTS sends a 401 because a certificate is revoked due to a rotation, attempt to reload once (like when the certificate has expired) #2444

@jmprieur

Description

@jmprieur

Is your feature request related to a problem? Please describe.
Today, Microsoft identity web detects that a certificate has an invalid key or has expired (Constants.InvalidKeyError or Constants.SignedAssertionInvalidTimeRange), and retries to load the certificate from the certificate description.

See:

private bool IsInvalidClientCertificateOrSignedAssertionError(MsalServiceException exMsal)
{
return !_retryClientCertificate &&
string.Equals(exMsal.ErrorCode, Constants.InvalidClient, StringComparison.OrdinalIgnoreCase) &&
#if !NETSTANDARD2_0 && !NET462 && !NET472
(exMsal.Message.Contains(Constants.InvalidKeyError, StringComparison.OrdinalIgnoreCase)
|| exMsal.Message.Contains(Constants.SignedAssertionInvalidTimeRange, StringComparison.OrdinalIgnoreCase));
#else
(exMsal.Message.Contains(Constants.InvalidKeyError) || exMsal.Message.Contains(Constants.SignedAssertionInvalidTimeRange));
#endif
}

with:

internal const string InvalidKeyError = "AADSTS700027";
internal const string SignedAssertionInvalidTimeRange = "AADSTS700024";

It does not look at the "certificate revoked" event ()

Describe the solution you'd like
Amend the IsInvalidClientCertificateOrSignedAssertionError method to add a test for AADSTS7000214: Certificate has been revoked.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions