Skip to content

Replace legacy System.IdentityModel.Tokens.Jwt#6356

Merged
david-poindexter merged 1 commit intodnnsoftware:release/10.0.0from
bdukes:identity-model
Feb 14, 2025
Merged

Replace legacy System.IdentityModel.Tokens.Jwt#6356
david-poindexter merged 1 commit intodnnsoftware:release/10.0.0from
bdukes:identity-model

Conversation

@bdukes
Copy link
Copy Markdown
Contributor

@bdukes bdukes commented Feb 4, 2025

This PR builds on top of #6350, which upgrades the System.IdentityModel.Tokens.Jwt NuGet package. That package is now marked as "legacy", so this follow-on PR replaces its usage with the recommended Microsoft.IdentityModel.JsonWebTokens package (which was already referenced). This was mostly straightforward, other than the header validation check that needed to be moved around a bit.

@bdukes bdukes added this to the 10.0.0 milestone Feb 4, 2025
@bdukes bdukes force-pushed the identity-model branch 3 times, most recently from e99f455 to b8ac135 Compare February 13, 2025 14:17
@bdukes bdukes force-pushed the identity-model branch 2 times, most recently from b57bebc to 6af6154 Compare February 13, 2025 15:47
@bdukes bdukes marked this pull request as ready for review February 14, 2025 20:15
Copy link
Copy Markdown
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested a jwt login and it worked fine, nice one.

Copy link
Copy Markdown
Contributor

@david-poindexter david-poindexter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 🎉

@david-poindexter david-poindexter merged commit abf1c44 into dnnsoftware:release/10.0.0 Feb 14, 2025
3 checks passed
@david-poindexter david-poindexter deleted the identity-model branch February 14, 2025 21:30
valadas added a commit to valadas/Dnn.Platform that referenced this pull request Dec 8, 2025
…hange

In dnnsoftware#6356 a dependency update made an unintentional breaking change. Instead of the classic "role" claim we now give a "http://schemas.microsoft.com/ws/2008/06/identity/claims/role" claim for roles.

JWT in itself has no specs for roles or claims which is left to whatever implementation is targetted like OIDC, OAuth, etc.

In DNN context it is a simple JWT but we do provide roles and the new package email values uses microsoft "standard" values that have been around in the Microsoft ecosystem since .Net Framework 4.5 and still lives all the way up to .Net 10.

I am not sure if we should support our old "role" claim forever or the Microsoft claim as there are 0 specs about "role". IETF does have a spec about "roles" so if we would change it to that spec, it would still be a breaking change.

What this PR does is provide both the old (<=9.13.9) behavior of "role" as well as the new microsoft way which may be better known in the .Net ecosystem. It also adds a deprecation note on both the plain and encrypted token to try and bring attention to this breacking change with the old way being obsolete and removed in v12.

Closes dnnsoftware#6829
donker pushed a commit that referenced this pull request Dec 9, 2025
…hange (#6832)

In #6356 a dependency update made an unintentional breaking change. Instead of the classic "role" claim we now give a "http://schemas.microsoft.com/ws/2008/06/identity/claims/role" claim for roles.

JWT in itself has no specs for roles or claims which is left to whatever implementation is targetted like OIDC, OAuth, etc.

In DNN context it is a simple JWT but we do provide roles and the new package email values uses microsoft "standard" values that have been around in the Microsoft ecosystem since .Net Framework 4.5 and still lives all the way up to .Net 10.

I am not sure if we should support our old "role" claim forever or the Microsoft claim as there are 0 specs about "role". IETF does have a spec about "roles" so if we would change it to that spec, it would still be a breaking change.

What this PR does is provide both the old (<=9.13.9) behavior of "role" as well as the new microsoft way which may be better known in the .Net ecosystem. It also adds a deprecation note on both the plain and encrypted token to try and bring attention to this breacking change with the old way being obsolete and removed in v12.

Closes #6829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants