Duende.AccessTokenMangement blocks JWT validation from version 3.1.0 onwards. #287
-
When installing Duende.AccessTokenManagement from version 3.1.0 onwards (version 3.0.1 seems to work fine), it seems to block the final call to /.well-known/openid-configuration/jwks and fail silently when adding a JwtBearer to the authentication pipeline. If debug events are added it seems to throw an error saying no key was given. It causes the issue as soon as the package is added to the project even before any code has been changed. The code below demonstrats the affected code, which works fine without Duende.AccessTokenManagement but not with it if the version is 3.1.0 or above. builder.Services.AddAuthentication("Bearer") |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Which version of Both You can check which versions your project is resolving by scanning your project using the following Powershell line: dotnet list package --include-transitive | sls "Microsoft.IdentityModel|System.IdentityModel" If the resulting list has different package versions, as shown in the example output below, then you need to add some of the outdated NuGet packages to pin their versions so that all of them are the same. Example output:
|
Beta Was this translation helpful? Give feedback.
Microsoft.AspNetCore.Authentication.JwtBearer
version 8.0.18 has a dependency onMicrosoft.IdentityModel.Protocols.OpenIdConnect
>= 7.1.2Can you try adding the package
Microsoft.IdentityModel.Protocols.OpenIdConnect
explicitly to your project as well, but setting the version to 8.13.0 instead? You may need to add additional NuGet packages (from that list above) to ensure they're all using the same version.