Blazor WASM: PlatformNotSupportedException inside the validation result is logged as a critical signature error
Sub-issue of LuckyPennySoftware/AutoMapper#4659.
Problem
On Blazor WebAssembly and other client platforms, RSA isn't supported. LicenseAccessor.ValidateKey has catch (PlatformNotSupportedException) to log a friendly message pointing to the client redistribution docs.
But JsonWebTokenHandler.ValidateTokenAsync doesn't throw here. It returns a failed result whose Exception is SecurityTokenInvalidSignatureException (IDX10511), with the PlatformNotSupportedException caught inside it. Support cases show exactly this: IDX10511 with an inner PlatformNotSupportedException. So the catch block never runs, and users get a critical-level "Error validating the Lucky Penny software license key" plus a signature error.
This is the biggest single category of license support cases (7 of 26), even though it's documented.
Fix
In src/AutoMapper/Licensing/LicenseAccessor.cs, when !validateResult.IsValid, check whether validateResult.Exception has a PlatformNotSupportedException anywhere inside it: walk InnerException, and also handle AggregateException. If it does, log the existing informational client-redistribution message instead of LogCritical. Keep the existing catch for platforms where the exception is thrown directly.
First confirm the exact exception shape on a real Blazor WASM app. The support logs show IDX10511 wrapping the exception, but check where it sits in the chain.
Tests
- Unit test: a validation result whose exception contains a nested
PlatformNotSupportedException→ info-level client-redistribution message, and no critical log. - Manual: Blazor WASM sample with a license key set → friendly message only.
Generated with Claude Code
Source: LuckyPennySoftware/AutoMapper