-
-
Notifications
You must be signed in to change notification settings - Fork 150
TypeLoadException when we use Microsoft.Owin 4 #165
Comments
Hello ysmoradi, I had a similar issue. But instead of using Microsoft.Owin.Security.Jwt, Version=4.0.0.0 I solved it by jus removing all packaged that had dependencies with Microsoft.Owin.Security.Jwt and then reinstalling Microsoft.Owin.Security.Jwt V4.0.2. This is how I solved it: Hope it helps. |
About using IdentityServer4.AccessTokenValidation in .NET full / Web API 2 / Owin app About "Katana does not support v5.0 of that package" >> This is not true as well. Microsoft.Owin 4 alpha, supports that package. (That happened recently, so it makes scene that you're not aware of that) The main problem is IdentityServer3.AccessTokenValidation which uses Microsoft.Owin.Security.Jwt behind the scene is not compatible with its new version. I'm here to discuss about that. "Microsoft.Owin.Security.Jwt V4.0.2" >> As far as I know, there is no nuget package with this version as you can see here. |
Oh yeah? prove it. Show me your working code sample. But if you don't believe me...maybe you can believe in Dominick Baier (you know, the guy that built IdentityServer).
I didn't say that "Katana" doesn't support that. I said "OWIN". Can you tell the difference? And, again, maybe I can quote Dominick on this:
Apart from that...your comment made sense. |
Things have been changed recently. All links you've provided are all about Katana (An owin implementation) version 3. Microsoft team has released Katana 4 recently (It's alpha although), and it's compatible with System.IdentityModel.Tokens.Jwt V5 Take a look at this issue. This sample code has web api 2 / owin on top of asp.net core / .net core. You've IApplicationBuilder there, and you can configure identity server 4 access token validation using following code to protect web api 2 controller. // Call this before dependencyManager.RegisterDefaultWebApiConfiguration();
dependencyManager.RegisterAspNetCoreMiddlewareUsing(aspNetCoreApp =>
{
// aspNetCoreApp is IApplicationBuilder, and you can configure identity server 4 access token validation using that.
}); To have better understanding, you can read our docs This code in asp.net core's repository allows you to run owin pipeline on top of asp.net core's pipeline and vice e versa. |
Preview version of Owin 4 is released. Nothing changed?https://www.nuget.org/packages/Microsoft.Owin.Security.Jwt/4.0.0-preview1 |
Microsoft's Owin team is working on new version of Owin/Katana. Microsoft.Owin.Security.Jwt now uses latest version of System.IdentityModel.Tokens.Jwt and Microsoft.IdentityModel.Tokens nuget package
When I tried to use Microsoft.Owin.Security.Jwt alongside IdentityServer3.AccessTokenValidation, I received following exception:
Could not load type 'Microsoft.Owin.Security.Jwt.IIssuerSecurityTokenProvider' from assembly Microsoft.Owin.Security.Jwt, Version=4.0.0.0 at Owin.IdentityServerBearerTokenValidationAppBuilderExtensions
The text was updated successfully, but these errors were encountered: