IdentityServer / IdentityServer3.AccessTokenValidation

OWIN Middleware to validate access tokens from IdentityServer3
Apache License 2.0
91 stars 149 forks source link

System.MissingMethodException: Method not found #115

Closed CesarD closed 7 years ago

CesarD commented 7 years ago

I'm getting this error on a WebAPI project when using a Javascript app with oidc-client-js. When I call my API method to get a value, it doesn't authorize me and the Katana trace log keeps recording this:

Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationMiddleware Error: 0 : Authentication failed
System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerable`1<System.Tuple`2<System.String,System.String>> IdentityModel.Client.IntrospectionResponse.get_Claims()'.
   at IdentityServer3.AccessTokenValidation.IntrospectionEndpointTokenProvider.<ReceiveAsync>d__1.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at IdentityServer3.AccessTokenValidation.IntrospectionEndpointTokenProvider.ReceiveAsync(AuthenticationTokenReceiveContext context)
   at Microsoft.Owin.Security.OAuth.OAuthBearerAuthenticationHandler.<AuthenticateCoreAsync>d__0.MoveNext()
    ProcessId=38312
    DateTime=2016-10-18T12:31:23.8218062Z

I already checked all nugets versions. I'm on the latest stable version of everything and also did a full clean solution and tried to recompile and re-run the solution all over again, but still the same.

BTW: I'm able to make a call to this same api method from a console application using Client Credentials, but just can't do it when calling it from the javascript client (angular one).

Any advice? Thanks.

leastprivilege commented 7 years ago

Being on the latest stable version of everything is not the way to go with Nuget. You need to be on the lastest non-breaking version that your library was compiled against.

It looks like you are using IdentityModel v2 - but the middleware was compiled against v1 - a major version change is by definition a breaking change.

CesarD commented 7 years ago

Ok, got back to IdentityModel v1.13.0 and it's working perfectly again. Perhaps you guys need to set a limit on the Dependencies version for the package IdentityServer3.AccessTokenValidation: IdentityModel (>= 1.9.2 & <2.0), so other people don't get all messed up when trying to update nugets packages. At least until you make the package compatible with the latest version of IdentityModel.

Thanks!

leastprivilege commented 7 years ago

see https://github.com/IdentityServer/IdentityServer3.AccessTokenValidation/issues/113

We accept PRs