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

There may be problems with version 4.3.0. #1766

Closed
1 task done
maliming opened this issue May 4, 2023 · 6 comments · Fixed by #1771
Closed
1 task done

There may be problems with version 4.3.0. #1766

maliming opened this issue May 4, 2023 · 6 comments · Fixed by #1771

Comments

@maliming
Copy link

maliming commented May 4, 2023

Confirm you've already contributed to this project or that you sponsor it

  • I confirm I'm a sponsor or a contributor

Version

4.x

abpframework/abp#16479

Describe the bug

A bug was found in Identity Model version 6.30.0

AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2059

We are using it in 4.3.

https://github.com/openiddict/openiddict-core/blob/4.3.0/Directory.Packages.props#LL41C1-L41C114

@kevinchalet
Copy link
Member

Thanks for the report, @maliming!

I'm not able to reproduce this issue in any of the OpenIddict samples so I suspect it only occurs when referencing either the OIDC or JWT bearer ASP.NET Core packages: both of these packages reference System.IdentityModel.Tokens.Jwt, a package which is not referenced/used by OpenIddict itself (that depends on the newer IdentityModel JWT stack).

So, if you reference Microsoft.AspNetCore.Authentication.JwtBearer (or the OIDC package), System.IdentityModel.Tokens.Jwt 6.15.1 is indirectly referenced. And given that the IM team probably introduced a breaking change in their internal helpers, it doesn't play nicely with Microsoft.IdentityModel.Tokens version 6.30.0.

Can you please try to explicitly add a reference to System.IdentityModel.Tokens.Jwt 6.30.0 to see if it helps?

@maliming
Copy link
Author

maliming commented May 5, 2023

Thanks @kevinchalet

Since it doesn't affect OpenIddict, I closed it.

There will be an error if you use AddJwtBearer or AddOpenIdConnect.

👍

@maliming maliming closed this as completed May 5, 2023
@kevinchalet
Copy link
Member

@maliming my pleasure.

That would be interesting to know whether explicitly referencing System.IdentityModel.Tokens.Jwt 6.30.0 with OpenIddict 4.3.0 fixes this error.

@maliming
Copy link
Author

maliming commented May 9, 2023

hi

We have to degrade the openiddict to 4.2, haven't tried explicitly referencing. but I guess it will work.

AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2059 (comment)

@kevinchalet
Copy link
Member

We have to degrade the openiddict to 4.2, haven't tried explicitly referencing. but I guess it will work.

Makes sense, but the problem will reappear if people update OpenIddict in their ABP app without also using the latest System.IdentityModel.Tokens.Jwt, so it's not a perfect solution either.

@satlom
Copy link

satlom commented May 11, 2023

I also was forced to downgrade to OpenIdDict to 4.2 to get it to work.
[https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2059#issuecomment-1543397271]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@maliming @kevinchalet @satlom and others