Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load type 'System.IdentityModel.Tokens.TokenValidationParameters' from assembly 'System.IdentityModel.Tokens.Jwt, Version=6.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 #374

Closed
Ayvid opened this issue Aug 14, 2020 · 9 comments

Comments

@Ayvid
Copy link

Ayvid commented Aug 14, 2020

I m getting this error when on IDS bearer Token auth UseIdentityServerBearerTokenAuthentication .
app framework 4.6
Identity Model - 3.8
here is the package info attached : -
packageInfo.txt

Please help

@Tratcher
Copy link
Member

You have
<package id="Microsoft.Owin.Security.OpenIdConnect" version="4.1.0" targetFramework="net461" />
And
<package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net461" />

There were significant breaks in the IdentityModel dependencies between 3.x and 4.x. All Microsoft.Owin packages need to be 4.1.0.

@Ayvid
Copy link
Author

Ayvid commented Aug 15, 2020

Thank you for the response @Tratcher
I want to specify few thing about my application here : -

  1. It is a web application and we have openIdConnect and cookieAuth functional for this app with IdentityModel 3.8
  2. its n -layered , and my web app is calling multi apis integrated with in the same solution.

Now we want to implement ids Bearer Token Auth for that I added IdentityServer3.AccessTokenValidation version="2.11.0"
so, after i updated the packages for Owin to 4.1.0 as suggested , i can see the updated versions in the web config as well but now too I get this error :
'Could not load type 'Microsoft.Owin.Security.Jwt.IIssuerSecurityTokenProvider' from assembly 'Microsoft.Owin.Security.Jwt, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.'

and here is the package info attached: -
packageInfo (1).txt

Please advise.

@Tratcher
Copy link
Member

Your dependencies are still out of sync, something in your graph depends on Microsoft.Owin.Security.Jwt 3.x and needs to be updated. If it can't be then you'll need to downgrade Microsoft.Owin.* to 3.1.

@Ayvid
Copy link
Author

Ayvid commented Aug 15, 2020

ok , let me try that , will let u know

@Ayvid
Copy link
Author

Ayvid commented Aug 15, 2020

@Tratcher i verified dependencies of all the packages that i m using for this app, most of them are having owin dependency >=2x or >= 3x . it seems they should be compatible , but the point is i upgraded Owin to 4.1 so i can't downgrade it now,

do we have any way to catch this dependent package causing this error?

@Ayvid
Copy link
Author

Ayvid commented Aug 16, 2020

i had gone through the similar issue described here IdentityServer/IdentityServer3.AccessTokenValidation#165 .
do we have any on going issue with latest version? Please help

@Tratcher
Copy link
Member

Indeed, it looks like IdentityServer3.AccessTokenValidation is stuck with an old dependency on Microsoft.Owin.Security.Jwt 3.0.1. There were breaking changes in 4.0 so if you want to continue using IdentityServer3.AccessTokenValidation you'll need to continue using Microsoft.Owin.Security.Jwt 3.x (and 3.x for all Microsoft.Owin packages).

@Ayvid
Copy link
Author

Ayvid commented Aug 16, 2020

thank you , yes you are correct !!, I too just found the same errors relating to IdentityServer3.AccessTokenValidation.
This is the error i was able to track.
Exception thrown: 'System.TypeLoadException' in IdentityServer3.AccessTokenValidation.dll
An exception of type 'System.TypeLoadException' occurred in IdentityServer3.AccessTokenValidation.dll but was not handled in user code
Could not load type 'Microsoft.Owin.Security.Jwt.IIssuerSecurityTokenProvider' from assembly 'Microsoft.Owin.Security.Jwt, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

@ghost
Copy link

ghost commented Aug 17, 2020

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Aug 17, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants