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

Meaningless error when using both Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.4 and System.IdentityModel.Tokens.Jwt 7.5.0 or higher #55194

Closed
1 task done
CunesPoort8 opened this issue Apr 18, 2024 · 5 comments
Labels
area-security External This is an issue in a component not contained in this repository. It is open for tracking purposes.

Comments

@CunesPoort8
Copy link

CunesPoort8 commented Apr 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using the Microsoft.AspNetCore.Authentication.OpenIdConnect package version 8.04 and the System.IdentityModel.Tokens.Jwt package version 7.5.0 or higher, a meaningless error arises not pointing in the direction of the cause.

Screenshot 2024-04-18 at 09 57 14

All works well when the System.IdentityModel.Tokens.Jwt package is deleted and the Microsoft.AspNetCore.Authentication.OpenIdConnect package uses its default 7.1.2 version.

Expected Behavior

A working login procedure with up to date System.IdentityModel.Tokens.Jwt package. Please add support for this package in the latest Microsoft.AspNetCore.Authentication.OpenIdConnect package.

Steps To Reproduce

Install both packages and perform an open id connect login procedure with only a Authority set, so the Open ID connect middleware will figure out it's configuration from the .well-known/openid-configuration endpoint.

See https://github.com/POORT8/AspNetCore.Repro.55194 for a minimal reproduction repo.

Exceptions (if any)

No response

.NET Version

.NET 8

Anything else?

No response

@utarn
Copy link

utarn commented Apr 19, 2024

I also got this error when upgrading from Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.2 to Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.4

@SteveSandersonMS SteveSandersonMS added the Needs: Repro Indicates that the team needs a repro project to continue the investigation on this issue label Apr 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Apr 30, 2024
@CunesPoort8
Copy link
Author

The minimal repro project can be found here: https://github.com/POORT8/AspNetCore.Repro.55194

@dotnet-policy-service dotnet-policy-service bot added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels May 3, 2024
@SteveSandersonMS SteveSandersonMS added investigate and removed Needs: Repro Indicates that the team needs a repro project to continue the investigation on this issue labels May 7, 2024
@halter73
Copy link
Member

halter73 commented May 7, 2024

If you add the following to your csproj, does it fix your issue?

<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.5.1" />

AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2513 is tracking the issue related to mismatched IdentityModel dependencies causing hard-to-diagnose errors. The current plan appears to produce a build-time warning, but I'm not sure what the timeframe for adding that warning is.

The right thing to do would be to avoid breaking changes to Microsoft.IdentityModel.Tokens, particularly changes that break older Microsoft.IdentityModel.Protocols.OpenIdConnect versions in such a severe and hard-to-diagnose way, but that's an issue for the https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/ repo, not here.

@halter73 halter73 removed investigate Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels May 7, 2024
@halter73 halter73 removed their assignment May 7, 2024
@halter73 halter73 added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label May 7, 2024
@CunesPoort8
Copy link
Author

Hi @halter73, yes indeed this fixes the issue both in the minimal repro project as well in our project where we encountered the issue. Is this your proposed solution? Is there any plan on updating the Microsoft.IdentityModel.Protocols.OpenIdConnect package in the Microsoft.AspNetCore.Authentication.OpenIdConnect package any time soon? Also to replace the deprecated System.IdentityModel.Tokens.Jwt which is in there?

@dotnet-policy-service dotnet-policy-service bot added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels May 8, 2024
@mkArtakMSFT
Copy link
Member

Closing as this is similar to #55355. We're working with the Entra team to get these addressed. Given that the work is not happening in this repo, closing this issue.

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
@mkArtakMSFT mkArtakMSFT added External This is an issue in a component not contained in this repository. It is open for tracking purposes. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-security External This is an issue in a component not contained in this repository. It is open for tracking purposes.
Projects
None yet
Development

No branches or pull requests

5 participants