BUG : System.IdentityModel.Tokens.Jwt 6.12.1 causes exceptions
See original GitHub issueI have several API projects where this package was installed. I recently updated to 6.12.1 from 6.12.0 through nuget and started getting exceptions.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'.
---> System.MissingMethodException: Method not found: 'Void Microsoft.IdentityModel.Logging.IdentityModelTelemetryUtil.SetTelemetryData(System.Net.Http.HttpRequestMessage)'.
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authorization.Policy.PolicyEvaluator.AuthenticateAsync(AuthorizationPolicy policy, HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
Oddly, I found that I actually no longer need this package at all, and have removed it, thus solving my issue. But I’m wondering if 6.12.1 has some dependency problem when installed.
Issue Analytics
- State:
- Created 2 years ago
- Comments:34 (16 by maintainers)
Top Results From Across the Web
Error loading System.IdentityModel.Tokens.Jwt dll in ...
I ran into the exactly same troubles. The reason is, that the latest versions of System.IdentityModel.Tokens.Jwt and System.IdentityModel.
Read more >Could not load file or assembly System.IdentityModel. ...
The error occurs when upgrading Microsoft.NET.Sdk.Functions to version 3.0.4 or 5 from 3.0.3 Full error: Could not load file or assembly ...
Read more >SecurityTokenValidationException Class
Initializes a new instance of the SecurityTokenValidationException class using the specified error message. SecurityTokenValidationException(String, Exception).
Read more >System.IdentityModel.Tokens.Jwt 6.32.1
Includes types that provide support for creating, serializing and validating JSON Web Tokens.
Read more >SecurityTokenExpiredException reported in Azure #10625
That error is thrown by System.IdentityModel.Tokens.Jwt.ValidateToken method, (see:https://docs.microsoft.com/en-us/dotnet/api/system.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed. If I take another explicit dependency on
the exception is resolved.
In my case, it may have been related to a cached instance of our repository manager on my local machine. Once the bad package was removed from nuget and I invalidated my cache, builds succeeded again.
My repro was to reference a dependency which referenced this package. Beyond that I can’t say unfortunately.
On Fri, Aug 13, 2021 at 6:13 PM henrikm @.***> wrote: