[Bug] MissingMethodException is thrown (IDX20803)
See original GitHub issueWhich version of Microsoft.IdentityModel are you using? Microsoft.IdentityModel.Tokens 6.20.0
Where is the issue?
- M.IM.Logging
- M.IM.Tokens
Is this a new or an existing app? The app is in production and I have upgraded to a new version of Microsoft.IdentityModel.Tokens (from 6.11.1 to 6.20.0)
Repro Everything worked without any issues until I have upgraded Microsoft.IdentityModel.Tokens from 6.11.1 to 6.20.0. Now when I am trying to log in I am getting this exception:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘https://localhost:5001/.well-known/openid-configuration’. —> System.MissingMethodException: Method not found: ‘Void Microsoft.IdentityModel.Logging.IdentityModelTelemetryUtil.SetTelemetryData(System.Net.Http.HttpRequestMessage)’.
Expected behavior It should work as before without changing any settings or adding new NuGet Package. I tried to install Microsoft.IdentityModel.Logging package (before I had just Microsoft.IdentityModel.Tokens installed in my project) but it didn’t helped. I can’t find any breaking changes between versions 6.11.1 and 6.20.0 but maybe something has changed and needs to be changed?
Actual behavior An exception in thrown, before upgrading to latest package version everything worked properly:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘https://localhost:5001/.well-known/openid-configuration’.
—> 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.ConfigurationManager1.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.AuthenticationHandler1.AuthenticateAsync() at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme) at Microsoft.AspNetCore.Authentication.AuthenticationHandler
1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@tomaszzmudzinski did you upgrade just M.IM.Tokens or all of the assemblies? They must all be at the same version.
We have the same issue, upgraded from 6.10.0, issue starts in 6.14 to 6.16