Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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

Closed
jmprieur opened this issue Sep 6, 2023 · 1 comment · Fixed by #2450
Assignees

Comments

@jmprieur
Copy link
Collaborator

jmprieur commented Sep 6, 2023

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.

@jennyf19
Copy link
Collaborator

jennyf19 commented Sep 8, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants