-
Notifications
You must be signed in to change notification settings - Fork 349
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
Updates for .NET8 Preview 7 #1401
Conversation
This is needed because of changes in the token handler
The new version of wilson deserializes the claims differently. This commit changes the DPoP's use of the jwk claim and adds a test that we still handle complex subclaims (arrays for key_ops)
The new wilson version's limitation when reading a complex Header and Payload value into a dictionary is that it requires that you specify the concrete Dictionary type rather than the IDictionary interface. Thus, we can go back to the original way of reading the jwk, and then serializing it into json to pass to the JsonWebKey ctor, we just need to use Dictionary instead of IDictionary when retrieving the header.
The test in question creates a proof token, and now creates the jwk parameters as a Dictionary<string, object> rather than an anonymous type which is then serialized by System.Text.Json. In the new wilson version, claims can be passed as dictionaries, but not as anonymous types.
Also, @josephdecock, take note of the warnings about obsolete APIs that are being used. We should find the new/replacement APIs and use those now instead. |
ValidateToken has been deprecated
JWTs are already representing the jwk claim as a JsonElement, and we don't need additional conversions
AddAsync is only needed for value generators that need async database access (e.g., HiLoValueGenerator), and we don't use those generators
Code analysis points out that that throws if the header is already set. In this situation, multiple www-authenticate headers would be nonsense, so we explicitly throw if that happens.
All the warnings are now resolved as well.
|
...maybe we want to wait for preview 8. As expected the JWT handler has some regressions (e.g. "sub claim is missing").