TokenValidationParameters no longer working after upgrade to 5.0.0

后端 未结 5 790
梦谈多话
梦谈多话 2020-12-24 04:39

I have the following code which was working when I was using System.IdentityModel.Tokens.Jwt, Version=4.0.20622.1351

private static void Co         


        
相关标签:
5条回答
  • 2020-12-24 05:17

    I don't know when or if this will ever be fixed, but I hope it will. I've already posted these issues on the Github site for the AAD extensions and on the Katana site. You can follow along with the discussions and progress on those sites, and if you care to, you can always post your interest in seeing this addressed.

    I can't understand how this was not seen as an issue before release. "Upgrade to .Net Core" is not a reasonable solution. My app has no chance of doing that for a good while, as do most non-trivial projects.

    0 讨论(0)
  • 2020-12-24 05:20

    TokenValidationParameters is in assembly: Microsoft.IdentityModel.Tokens

    It looks like you are using Katana (the first version of asp.net OWIN offering). Katana does not support 5.0.0. You need to stick with 4.x.

    The latest version of asp.net takes a dependency on S.IM.xx and M.IM.xxx 5.0. https://github.com/aspnet

    0 讨论(0)
  • 2020-12-24 05:22

    Katana currently will not work with the 5.x version of IdentityModel. https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet

    However, there is work underway to fix this. Timeline is not set yet.

    0 讨论(0)
  • 2020-12-24 05:31

    Short version: Make sure you use version 4.0 or later of the Microsoft.Owin packages, such as Microsoft.Owin.Security.Jwt.


    As the other answers mentioned, there was a breaking change in System.IdentityModel.Tokens.Jwt from version 4.0 to 5.0. This caused problems because some packages like Microsoft.IdentityModel.Protocols depended on version 5.0, while older Katana/OWIN packages like Microsoft.Owin.Security.Jwt were still hardcoded to depend on version 4.0.

    The good news is that this is being fixed in the new Katana 4.0 release. The 4.0 packages (such as Jwt and Cookies) have been published to NuGet as prerelease packages and will be available as stable packages soon.

    0 讨论(0)
  • 2020-12-24 05:44

    So I am also experiencing the same issue today. After looking down to the bottom of it I think I know the answer.

    In short it is the issue with Katana project (http://katanaproject.codeplex.com/) being failed to comply with the current changes of Windows Azure Active Directory IdentityModel Extensions for .Net (https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet)

    For more details, TokenValidationParameters was there in System.IdentityModel.Tokens.Jwt assembly verion 4.0 but it has been moved out in version 5.0. The new home for it is now in assembly Microsoft.IdentityModel.Tokens.

    Sorry I can not provide a fix it is a design change from which the Katana code base needs to be dramatically refactored.

    0 讨论(0)
提交回复
热议问题