-
Notifications
You must be signed in to change notification settings - Fork 184
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
Arrays are not getting populated in latest version of package #185
Comments
Hi @TL-Onam , in v3.2 Newtonsoft.Json was dropped in favor of System.Text.Json for default serialization mechanism. That's probably what's causing issues if you want to use object payloads. You can still continue using Newtonsoft if you prefer, the previous implementation still living in repo: https://github.com/dvsekhvalnov/jose-jwt/blob/master/jose-jwt/json/NewtonsoftMapper.cs You can use it as an example and register as default one, see: https://github.com/dvsekhvalnov/jose-jwt#customizing-json---object-parsing--mapping Jose.JWT.DefaultSettings.JsonMapper = new MyNewtonsoftMapper(); But also check carefully your example, you deserializing claims as Let me know if it doesn't work, i'll try to run your sample then. |
The interesting thing about this is that if I were to do this (see below) it works fine.
Changing the default settings does the job but does introduce a lot more code than the one liner I've done above. I did change the mix of deserialization, thanks for that spot. |
But you just assigning "scope" key in claims dictionary. That's obviously will work :) Little bit unclear do you want to use object models payload or just generic strings/dictionaries? |
In version 3.1.1 I was able to create JWTs using the following object structure (see below) but in the latest release (both 3.2.0 and 4.0.0) this is failing. I get a JWT back but when I validate this at either jwt.io or jwt.ms the
scopes
array is empty (using latest version) however downgrade the package to 3.1.1 it works fine.This is the expected output:
However with anything above 3.1.1 I get:
Reproduce by copying and pasting this code:
Am I doing something wrong here? Something has changed but perhaps I need to do something different..
The text was updated successfully, but these errors were encountered: