Skip to content

How to replace usage of SecurityTokenUnableToValidateException in code

Tim Hannifin edited this page Apr 24, 2023 · 3 revisions

SecurityTokenUnableToValidateException is no longer getting thrown by Microsoft.IdentityModel/Wilson. In the 7.* major release of Wilson this exception type will be removed completely.

Callers of Wilson should be sure to handle SecurityTokenValidationExceptions individually, or at the very least, handle all exception types of SecurityTokenValidationException.

If you were previously ONLY handling SecurityTokenUnableToValidateException, you should replace that with SecurityTokenValidationException and ideally have exception handling for derrived types (e.g. SecurityTokenExpiredException, SecurityTokenInvalidIssuerException, SecurityTokenNotYetValidException, etc.)

More detailed exception handling guidance can be found: TODO, Brent to share exception handling guidance for Wilson.

Clone this wiki locally