See the releases for details on bug fixes and added features.
- Update System.Text.Json to 8.0.5 CVE-2024-43485. See 2892.
- Using FixedTimeEquals in NETCore targets. See 2857.
- Updated .NET 9 to RC 2 2898.
- Adds ability to create token without kid 2968
- Enables code coverage in PRs 2946
- Various test improvements:
- #2953
- #2955
- #2951
- #2952
- #2947
Work related to redesign of IdentityModel's token validation logic #2711
- Validates Audience for SAML2TokenHandler with New Model 2863
- Improvements to AudienceValidation 2902
- Added properties to ValidationResult 2923
- Implements Audience and Lifetime validations in SamlSecurityTokenHandler 2925
- Implements Issuer validation in SamlSecurityTokenHandler 2948
- CaseSensitiveClaimsIdentity.Clone() now returns a
CaseSensitiveClaimsIdentity
as expected. See 2879 - Multiple unused and unusable (for the moment) public APIs were removed. These were introduced by mistake leaking from the work done on logging and exception handling. See 2888. No major version changed needed as these APIs were not usable per se.
- Enabled PublicApiAnalyzers to better understand and trace changes to the public API. See2782
- Fix bug where ConfigurationManager was updating keys too frequently. See 2866 for details.
- Improves performance during issuer validation by replacing string comparison with span comparison. See PR #2826.
- Add optional check to prevent using keys that are shared across multiple clouds. See issue #2832 for details.
- JsonWebTokenHandler would only return unwrapped keys if there was no errors. This change is to align with the behavior in JwtSecurityTokenHandler, that is it returns the keys that were able to be unwrapped, and only throw if no keys were able to be unwrapped. See issue #2695 for details.
- Fix flaky tests. See #2793 for details.
- Update XUnit versoin and fix test warnings due to new XUnit analyzers. See PR #2796 for details.
- Onhboard to code coverage in ADO. See PR #2798.
- Use
IsTargetFrameworkCompatible(*)
so AOT is forward-compatible with .NET 9 and beyond. See PR #2790 for details. - Fix a merge conflict impacting dev. See PR #2819.
- Defining the following attribute in multiple assemblies (.Tokens, .Logging) causes an internal error. [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]. See PR #2820.
- Remove perl dependency. See PR #2830.
Work related to redesign of IdentityModel's token validation logic #2711
- Add
BannedApiAnalyzers
to prevent use ofClaimsIdentity
constructors. See PR #2778 for details.
- IdentityModel now allows the JWT payload to be an empty string. See issue #2656 for details.
- Cache
UseRfcDefinitionOfEpkAndKid
switch. See PR #2747 for details. - Method was named
DoNotFailOnMissingTid
in 7x andDontFailOnMissingTid
in 8x, adding the method for back compat. See issue #2750 for details. - Metadata is now updated on a background thread. See #2780 for details.
JsonWebKeySet
stores the original string it was created with. See PR #2755 for details.- Restore AOT compatibility. See #2711.
- Fix OpenIdConnect parsing bug. See #2772 for details.
- Remove the lock on creating a
SignatureProvider
. See #2788 for details.
- Test clean up #2742.
- Use only FxCop in .NET framework targets #2693.
- Add rule to add file headers automatically #2748.
- Code analysis updates #2746.
- Include README packages in NuGet #2752.
- Update projects inside WilsonUnix solution #2768.
- Code style enforced in build #2603.
- CodeQL update #2767.
- Update build pipeline to new one release build format #2777.
- Update GitHub actions to
9.0.100-preview.7.24407.12
and add<NoWarn>$(NoWarn);SYSLIB0057</NoWarn>
due to breaking changes in preview7. #2786.
Work relating to #2711
- IdentityModel now resolves the public key to EPK. See issue #1951 for details.
- Fix a race condition where
SignatureProvider
was disposed but still able to leverage the cache andSignatureProvider
now disposes when compacting. See PR #2682 for details. - For JWE,
JsonWebTokenHandler.ValidateJWEAsync
now considers the decrypt keys in the configuration. See issue #2737 for details.
AppContext.TryGetSwitch
statically caches internally but takes out a lock. .NET almost always caches these values. They're not expected to change while the process is running unlike normal config. IdentityModel now caches the value. See issue #2722 for details.
- See PR #2707 for details.
Full list of breaking changes.
- A derived
ClaimsIdentity
where claim retrieval is case-sensitive. The currentClaimsIdentity
, in .NET, retrieves claims in a case-insensitive manner which is different than querying the underlyingSecurityToken
. The newCaseSensitiveClaimsIdentity
class provides consistent retrieval logic withSecurityToken
. Fallback to previous behavior via an AppContext switch. See PR #2700 for details. - Make
CollectionUtilities.IsNullOrEmpty
internal. See issues #2651 and #1722 for details.
- See design proposal #2711 for details, all work internal for now. Please comment in the GitHub issue and provide feedback there.
- Allow users to provide a
Stream
toWrite
inOIDCConfigurationSerializer
. See PR #2698 for details.
- Remove dependency on
AadIssuerValidator.GetTenantIdFromToken
inValidateIssuerSigningKey
, to only consider thetid
. An AppContext switch enables fallbacking to the previous behavior, which should not be needed. See PR #2680 for details. - Continuation of #2637 and #2646. Add the metadata
authorization_details_types_supported
from RFC 9396 - OAuth 2.0 Rich Authorization Requests toOpenIdConnectConfiguration
. - The class
OpenIdConnectPrompt
now has thecreate
prompt from Initiating User Registration via OpenID Connect 1.0 - The following grant types are now included in
OpenIdConnectGrantTypes
:urn:ietf:params:oauth:grant-type:saml2-bearer
from RFC 7522 - Security Assertion Markup Language (SAML) 2.0 Profile for OAuth 2.0 Client Authentication and Authorization Grants,urn:ietf:params:oauth:grant-type:jwt-bearer
from RFC 7523 - JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants,urn:ietf:params:oauth:grant-type:device_code
from RFC 8628 - OAuth 2.0 Device Authorization Grant,urn:ietf:params:oauth:grant-type:token-exchange
from RFC 8693 - OAuth 2.0 Token Exchange,urn:openid:params:grant-type:ciba
from OpenID Connect Client-Initiated Backchannel Authentication Flow - Core 1.0 - Serialize byte arrays as base64 strings in Json tokens. This was the behavior in 6.x releases. See issue #2524 for details.
- When we added virtuals to abstract methods that threw in the base class, we then called those methods that were implemented in user derived classes. The user code would fault with a
NotImplementedException
. Now a message is returned that the user can act on to fix the issue. See issue #1970.
- Remove code that was used in target frameworks that got removed. See PR #2673 for details.
- Rename local variables for better readability. See PR #2674 for details.
- Refactor XML comments for improved clarity. See PR #2676, #2677, #2678, #2689 and #2703 for details.
- Fix flaky test. See issue #2683 for details.
- Made
ConfigurationManager.GetConfigurationAsync
a virtual method. See PR #2661
- IdentityModel 8x no longer supports .net461, which has reached end of life and is no longer supported. See issue #2544 for details.
- Two IdentityModel extension dlls
Microsoft.IdentityModel.KeyVaultExtensions
andMicrosoft.IdentityModel.ManagedKeyVaultSecurityKey
were using ADAL, which is no longer supported . The affected packages have been removed, as the replacement is to use Microsoft.Identity.Web. See issue #2454 for details. AppContext.SetSwitch
which were included in IdentityModel 7x, have been removed and are the default in IdentityModel 8x. The result is a more performant IdentityModel by default. See issue #2629 and https://aka.ms/IdentityModel8x for details.
- Added an Audiences member to the SecurityTokenDescriptor to make it easier to define multiple audiences in JWT and SAML tokens. Addresses issue #1479 with PR #2575
- Add missing metadata parameters to OpenIdConnectConfiguration. See issue #2498 for details.
- Fix over-reporting of
IDX14100
. See issue #2058 and PR #2618 for details. JwtRegisteredClaimNames
now contains previously missing Standard OpenIdConnect claims. See issue #1598 for details.
- No longer for every string claim, calling DateTime.TryParse on each value, whether it is expected to be a DateTime or not. See issue #2615 for details.
- Update
JsonWebToken
- extract and expose the method that reads the header/payload property values from the reader so it can be overridden in children classes to add any extra own logic. See issues #2581, #2583, and #2495 for details.
- JWE header algorithm is now compliant to IANA document. See issue #2089 for details.
- Reduce the number of internal array allocations that need to happen for each claim set, see PR #2596.
- Add an AOT compatibility check on each PR to ensure only AOT compatible code is checked-in. See PR #2598.
- Update perl scrip for OneBranch build. See PR #2602.
- Add langversion 12 to benchmark tests. See PR #2601.
- Removed unused build.cmd file. See PR #2605.
- Create CodeQL exclusions file. See PR #2609.
- Fix variable usage in AOT script. See PR #2610.
- Move
Microsoft.IdentityModel.Tokens
delegates to a new file. See PR #2606
- Validate authentication tag length so a JWE with appended characters will not be considered a valid token. See issues #2201, #1641, PR #2569, and IDX10625 Wiki for details.
- App Context Switches in Identity Model 7x are now documented here.
- In .NET 6 or greater, use a temporary buffer to reduce intermediate allocation in
VerifyRsa
/VerifyECDsa
. See PR #2589 for more details. - Reduce allocations in
ValidateSignature
by using a collection expression instead ofnew List<SecurityKey> { key }
, to optimize for the single element case. See PR #2586 for more details. - Remove Task allocation in
AadIssuerValidator
. See PR #2584 for more details.
- Use Base64.DecodeFromUtf8InPlace for base64 decode that saves 12% on token read time. Note that JsonWebToken no longer throws ArgumentOutOfRangeException and ArgumentException exceptions. See PR #2504.
- Moved token lifetime validation logic to an internal static class. See PR #2547.
- Contribution from @martinb69 to fix correct parsing of
UserInfoEndpoint
. See issue #2548 for details.
- Supports the 1.1 version of the Microsoft Entra ID Endpoint #2503
SamlSecurityTokenHandler
andSaml2SecurityTokenHandler
now can fetch configuration when validating SAML issuer and signature. See PR #2412JsonWebToken.ReadToken
now correctly checks Dot3 index in JWE. See PR #2501
- Remove reference to
Microsoft.IdentityModel.Logging
inMicrosoft.IdentityModel.Protocols
, which already depends on it viaMicrosoft.IdentityModel.Tokens
. See PR #2508 - Adjust uppercase json serialization tests to fix an unreliable test method, add consistency to naming. See PR #2512
- Disable the 'restore' and 'build' steps of 'build and pack' in
build.sh
, improving speed. See PR #2521
- Introduced an injection point for external metadata management and adjusted the issuer Last Known Good (LKG) to maintain the state within the issuer validator. See PR #2480.
- Made an internal virtual method public, enabling users to provide signature providers. See PR #2497.
- Added a new JsonWebToken constructor that accepts Memory for improved performance, along with enhancements to existing constructors. More information can be found in issue #2487 and in PR #2458.
- Resolved the issue of duplicated log messages in the source code and made IDX10506 log message more specific. For more details, refer to PR #2481.
- Enhanced Json serialization by ensuring the complete object is always read. This improvement can be found in PR #2491.
- Streamlined the build and release process by replacing the dependency on updateAssemblyInfo.ps1 with the Version property. Check out the details in PR #2494.
- Excluded the packing of Benchmark and TestApp projects for a more efficient process. Details available in PR #2496.
- Replace propertyName with
MetadataName
constant. See issue #2471 for details. - Fix 6x to 7x regression where mixed cases OIDC json was not correctly process. See #2404 and #2402 for details.
- Update the benchmark configuration. See issue #2468.
- Update comment for
azp
inJsonWebToken
. See #2475 for details. - Link to breaking change announcement. See [#2478].
- Fix typo in log message. See [#2479].
Addition of the ClientCertificates property to the HttpRequestData class enables exposure of certificate collection involved in authenticating the client against the server and unlock support of new scenarios within the SDK. See PR #2462 for details.
Fixed bug where x5c property is empty in JwtHeader after reading a JWT containing x5c in its header, issue #2447, see PR #2460 for details. Fixed bug where JwtPayload.Claim.Value was not culture invariant #2409. Fixed by PRs #2453 and #2461. Fixed bug where Guid values in JwtPayload caused an exception, issue #2439. Fixed by PR #2440.
Remove linq from BaseConfigurationComparer, improvement #2464, for additional details see PR #2465.
New benchmark tests for AsymmetricAdapter signatures. For details see PR #2449.
Reduce allocations and transformations when creating a token #2395. Update Esrp Code Signing version to speed up release build #2429.
Improve benchmark consistency #2428. Adding P50, P90 and P100 percentiles to benchmarks #2411. Decouple benchmark tests from test projects #2413. Include pack step in PR builds #2442.
Improve logging in Wilson for failed token validation when key not found #2436. Remove conditional Net8.0 compilation #2424.
See https://aka.ms/IdentityModel/Jan2024/zip and https://aka.ms/IdentityModel/Jan2024/jku for details.
- Fix errors like the following reported by multiple customers at dotnet/aspnetcore#51005 when they tried to upgrade their app using
AddMicrosoftIdentityWebApp
to .NET 8. See PR for details. - Fix compatibility issue with 6x when claims are a bool. See issue #2354 for details.
- Resolved an issue where JsonWebToken properties would throw exceptions when the input string was 'null'. See PR#2335 for details.
- GetPayloadClaim("aud") returns a string when a single audience is specified, aligning with the behavior in 6.x. See PR#2331 for details.
See IdentityModel7x for the updates on this much anticipated release.
- Improve log messages. See PR #2289 for details.
- In
AadIssuerValidator
return aValueTask<string>
instead of aTask<string>
. See Issue #2286 and PR [#2287] for details. - Deprecate
int? JwtPayload.Exp
,.Iat
, and.Nbf
. See issue #2266 for details, #92, and #1525. - General clean-up. See PR #2285.
- Add nullables to the properties in
WsFederationMessage
. See issue #2240 for details. - Fix regression where
JsonWebToken.TryGetPayloadValue()
was not compatible with dictionary types. See issue #2246 for details. - Fix regression where dictionary claims added to
SecurityTokenDescriptor.Claims
are no longer correctly serialized. See issue #2245 for details. - Fix regression with a Y2038 bug. See issue #2261 for details.
- Fix a regression where claims with multiple values are incorrectly serialized. See #2244 for details.
- Remove sync-over-async pattern with
JsonWebTokens.ValidateToken
, which when in the hot path can lead to threadpool starvation. See issue #2253 for details. - Perf testing using benchmark dotnet and crank, similar to aspnetcore, to better gauge requests per second perf impacts. See issue #2232 for details.
- Use optimistic synchronization in
JsonWebToken.Audiences
. See PR for details. - Reduce allocations when enumerating over collections. See PR for details.
- Fix description for JWT X5tS256 field.
- Improvements to the build script to accommodate .NET's source-build requirements. See PR for details.
- Replace Newtonsoft.Json with System.Text.Json, see #2233, and as a result, ASP.NET's JwtBearer auth handler will now be fully AOT compatible.
-
Series of perf improvements in collaboration with ASP .NET Core DevDiv team, results in improvements from 280K Request per second (RPS) in
7.0.0-preview
to 370K RPS in7.0.0-preview2
, with more improvements to come in later versions: #2195, #2194, #2193, #2192, #2190, #2188, #2184, #2181, #2180, #2178, #2175, #2172, #2171, #2170, #2169, #2168, #2167, #2166, #2164, #2162, #2161, #2160, #2159, #2158, #2221 -
First increment in replacing newtonsoft with System.Text.Json, see #2174
-
Reading and writing JsonWebKey and JsonWebKeySet types now use System.Text.Json.Utf8JsonReaders/Writers for serialization. See PR @2208 for details.
-
Remove the use of Newtonsoft from OpenIdConnectConfiguration and OpenIdConnectMessage. See PR @2214 for details.
-
Fix casing Properties directory in
updateAssemblyInfo.ps1
script see, #2189 -
Add code coverage in ADO, see #2176
-
Add codeQL scanning for compliance, see #2151
Delisted from NuGet due to versioning inconsistency Include IdentityModel 6.32.0 release updates, including AAD specific signing key issuer validator and fix perf regression.
Join the 7x discussion and provide your feedback!
Relevant PRs for supporting .NET 8: #2108 #2121 #2122
Remove net45, see #2123
JwtSecurityTokenConverter, see #2117
- Fix logging messages. See #2288 for details.
- Underlying JsonDocument is never disposed, causing high latency in large scale services. See #2258 for details.
- Fix thread safety for
JsonClaimSet
Claims andJsonWebToken
Audiences. See #2185 for details.
- Adding an AAD specific signing key issuer validator. See issue #2134 for details.
- Better support for WsFederation. See PR for details.
- Address perf regression introduced in 6.31.0. See PR for details.
This release contains work from the following PRs and commits:
- Introduce ConfigurationValidationException(#2076)
- Disarm security artifacts(#2064)
- Throw SecurityTokenMalformedTokenException on malformed tokens(#2080)
- Add ClaimsMapping to JsonWebTokenHandler
This release contains work from the following PRs:
- Modified token validation to be async throughout the call graph #2075
- Enforce key sizes when creating HMAC #2072
- Fix AotCompatibilityTests #2066
- Use up-to-date "now", in case take long time to get Metadata #2063
This release addresses #1743 and, as such, going forward if the SymmetricKey is smaller than the required size for HMAC IdentityModel will throw an ArgumentOutOfRangeException which is the same exception when the SymmetricKey is smaller than the minimum key size for encryption.
Beginning in release 6.28.0 the library stopped throwing SecurityTokenUnableToValidateException. This version (6.30.0) marks the exception type as obsolete to make this change more discoverable. Not including it in the release notes explicitly for 6.28.0 was a mistake. This exception type will be removed completely in the next few months as the team moves towards a major version bump. More information on how to replace the usage going forward can be found here: https://aka.ms/SecurityTokenUnableToValidateException
Indicate that a SecurityTokenDescriptor can create JWS or JWE #2055 Specify 'UTC' in log messages https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/commit/ceb10b10ad2edb97217e263915d407da1d957e03 Fix order of log messages https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/commit/05eeeb513e66a4236ae519ef9304bf2b6f26766f
Fixed issues with matching Jwt.Kid with a X509SecurityKey.x5t #2057 #2061
Marked Exception that is no longer used as obsolete #2060
Added support for AesGcm on .NET 6.0 or higher https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/commit/85fa86af743e2b1a0078a9ecd956f34ee703acfc
First round of trimming analysis preparation for AOT #2042
Added new API on TokenHandler.ValidateTokenAsync(SecurityToken ...) implemented only on JsonWebTokenHandler. #2056
- Add BootstrapRefreshInterval (#2052)
- Added net462 target (#2049)
- Create the configuration cache in the BaseConfigurationManager class (#2048)
- Add BootstrapRefreshInterval (#2052)
- Added net462 target (#2049)
- Create the configuration cache in the BaseConfigurationManager class (#2048)
- Update Wilson logs with aka.ms pointers to known wikis in #2027
- Fix typo in documentation #2034
- Introduce a LKG configuration cache to store each valid base configuration instead of a single entry of configuration #2007
- Add encryption keys to base configuration #2023
- Updated CHANGELOG link #2026
Servicing release Set maximum depth for Newtonsoft parsing. #2024 Improve metadata failure message. #2010 Validate size of symmetric signatures. #2008 Added property TokenEndpoint to BaseConfiguration. #1998
Releasing a Hotfix for Wilson 6.26.0 that reverts async/await changes made in #1996 to address a performance reduction issue.
- Changes are in #2015
- Root cause analysis and fix will be tracked in #2017
Microsoft.IdentityModel has two assemblies to manipulate JWT tokens:
System.IdentityModel.Tokens.Jwt, which is the legacy assembly. It defines JwtSecurityTokenHandler class to manipulate JWT tokens. Microsoft.IdentityModel.JsonWebTokens, which defines the JsonWebToken class and JsonWebTokenHandler, more modern, and more efficient. When using JwtSecurityTokenHandler, the short named claims (oid, tid), used to be transformed into the long named claims (with a namespace). With JsonWebTokenHandler this is no longer the case, but when you migrate your application from using JwtSecurityTokenHandler to JsonWebTokenHandler (or use a framework that does), you will only get original claims sent by the IdP. This is more efficient, and occupies less space, but might trigger a lot of changes in your application. In order to make it easier for people to migrate without changing their app too much, this PR offers extensibility to re-add the claims mapping.
Unmasked non-PII properties in log messages - In Microsoft.IdentityModel logs, previously only system metadata (DateTime, class name, httpmethod etc.) was displayed in clear text. For all other log arguments, the type was being logged to prevent Personally Identifiable Information (PII) from being displayed when ShowPII flag is turned OFF. To improve troubleshooting experience non-PII properties - Issuer, Audience, Key location, Key Id (kid) and some SAML constants will now be displayed in clear text. See issue #1903 for more details.
Prefix Wilson header message to the first log message - To always log the Wilson header (Version, DateTime, PII ON/OFF message), EventLogLevel.LogAlways was mapped to LogLevel.Critical in Microsoft.IdentityModel.LoggingExtensions.IdentityLoggerAdapter class which caused confusion on why header was being displayed as a fatal log. To address this, header is now prefixed to the first message logged by Wilson and separated with a newline. EventLogLevel.LogAlways has been remapped to LogLevel.Trace. See issue #1907 for more details.
Copy the IssuerSigningKeyResolverUsingConfiguration delegate in Clone() #1909