You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit abeda24
Browse filesBrowse the repository at this point in the historyBrowse files
License validation: clear messages for malformed keys, client platforms, and IdentityModel version mismatches (#4670)
* License validation: clear messages for malformed keys and client platforms
- Check the key's structure (three base64url segments, 342-character RS256
signature) before validating, and log an error-level "incomplete or
corrupted" message instead of an IDX signature error (#4661). The key is
never logged.
- Add a copy/paste hint when validation fails with an invalid signature.
- Detect client platforms without RSA support, such as Blazor WASM (#4662).
JsonWebTokenHandler swallows the PlatformNotSupportedException and reports
IDX10511, with the original exception only as PII-hidden message text, so
probe RSA directly before validating. Also walk the result's exception
chain for a PlatformNotSupportedException.
Fixes#4661Fixes#4662
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Log plain license validation messages, keep IdentityModel details at debug
IDX exceptions aren't actionable for customers, and with PII logging off
they hide most details anyway. Log one plain critical message per failure
kind (invalid signature, undecodable token, wrong issuer/audience, other)
without the exception, and log the exception at debug level for support.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* License validation: name mismatched Microsoft.IdentityModel versions
Mixed Microsoft.IdentityModel.* package versions surface as IDX14102
wrapping a MissingMethodException (seen in support on MAUI). Report that
as a package version problem rather than a corrupted key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* License messages: link through /go redirects on luckypennysoftware.com
Shipped binaries live for years, so link to redirects we control
(license key, client platforms, IdentityModel versions) instead of docs
URLs that have already moved once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Docs: troubleshooting license key validation
Document the new validation messages (incomplete/corrupted key, signature
mismatch, not a Lucky Penny key, mismatched Microsoft.IdentityModel
versions), the client-platform INFO message, and how to see the
underlying exception at Debug level. These sections are the targets of
the /go redirects.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review: no missing-license warning on client platforms; CodeQL
- When license keys can't be validated on this platform (no RSA, e.g.
Blazor WASM), mark the license as validation-unsupported so the
validator skips the "no valid license key" warning after the INFO
client-platform message.
- Rename LicenseKeyLink to AccountPageLink: CodeQL's name heuristic
flagged the URL constant as sensitive data.
- Include the debug-level exception in the test failure message for the
plain-critical assertions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Skip the end-to-end invalid signature test on .NET Framework test host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Run net471 tests in an AppDomain so the generated binding redirects apply
The test host's AppDomain doesn't use AutoMapper.UnitTests.dll.config, so redirects such as
System.Threading.Tasks.Extensions were ignored and license validation failed to load them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Revert enabling xunit AppDomains on net471: tests are no longer discovered
With xunit.appDomain=ifAvailable the net471 run reports "No test is available" and passes with zero tests.
Back to skipping the end-to-end invalid signature test on .NET Framework.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This will depend on your logging setup. A missing/invalid license key does not affect runtime behavior in any way.
110
+
This will depend on your logging setup. A missing/invalid license key does not affect runtime behavior in any way.
111
+
112
+
If a license key is set on a platform that does not support RSA cryptography, such as Blazor WASM, AutoMapper skips validation and logs an INFO message linking to this section instead of a validation error.
113
+
114
+
## Troubleshooting License Key Validation
115
+
116
+
When a license key can't be validated, AutoMapper logs a message describing the problem. The underlying exception is logged separately at `Debug` level; to see it, enable debug logging for the `LuckyPennySoftware.AutoMapper.License` category:
The key is missing characters or contains characters that aren't part of a license key. This usually happens when the key is copied from a PDF or an email, where it can be truncated or wrapped across lines.
125
+
126
+
AutoMapper removes whitespace (spaces, tabs, and line breaks) from the key before validating it, so line breaks and trailing newlines, such as those in Kubernetes secrets created from files, are not a problem. Missing characters can't be recovered: copy the full key again from your [account page](https://luckypennysoftware.com/account).
127
+
128
+
### The license key signature does not match
129
+
130
+
The key is well formed but its contents have been changed, usually by a copy/paste or formatting problem. Copy the full key again from your [account page](https://luckypennysoftware.com/account).
131
+
132
+
Online JWT decoders such as jwt.io can show a damaged key as valid, because they ignore whitespace and don't check the signature against the Lucky Penny Software key. Use your account page as the source of truth.
133
+
134
+
### The license key is not a Lucky Penny Software license key
135
+
136
+
The value is a token, but not one issued by Lucky Penny Software. Check that the value you configured (in code or in the `AUTOMAPPER_LICENSE_KEY` or `LUCKYPENNY_LICENSE_KEY` environment variables) is the license key from your [account page](https://luckypennysoftware.com/account).
AutoMapper validates license keys with the `Microsoft.IdentityModel.JsonWebTokens` package. If your application references different versions of the `Microsoft.IdentityModel.*` packages (for example, through an authentication library that pins an older `Microsoft.IdentityModel.Tokens`), validation fails with an error such as:
141
+
142
+
```
143
+
System.MissingMethodException: Method not found: 'Void Microsoft.IdentityModel.Tokens.Base64UrlEncoder.Decode(...)'
144
+
```
145
+
146
+
To find the versions in use, run:
147
+
148
+
```
149
+
dotnet list package --include-transitive
150
+
```
151
+
152
+
Then reference the same version of every `Microsoft.IdentityModel.*` package, for example by adding direct references at the highest version in use:
If you use [Central Package Management](https://learn.microsoft.com/nuget/consume-packages/central-package-management), you can enable transitive pinning (`CentralPackageTransitivePinningEnabled`) and pin the versions in `Directory.Packages.props`.
0 commit comments