ASP.NET v5 Multiple SigningCredentials

前端 未结 1 1181
隐瞒了意图╮
隐瞒了意图╮ 2021-01-19 13:20

In ASP.NETv4 I used:

var signingKey = new HmacSigningCredentials(keyByteArray);

But in v5 the last parameter of new JwtSecurityToken(

相关标签:
1条回答
  • 2021-01-19 13:25

    The issue you're seeing is directly due to the fact you're referencing both ASP.NET Identity 2 and Identity 3 packages: Identity 2 references IdentityModel 4 (that comes with the full .NET framework) while the new stack uses IdentityModel 5. Sadly, both are incompatible and can't be referenced in the same project. You can find more information here: Ambiguous reference issue (Microsoft.AspNet.Identity & Microsoft.AspNet.Identity.Core)

    Remove your Microsoft.AspNet.Identity.Owin/Microsoft.Owin.Security references and it should work.

    If you need an alternative to OAuthAuthorizationServerMiddleware that works with ASP.NET 5, you can take a look at this other SO question: Configure the authorization server endpoint

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