Create JWT token with JSON array #2553
YashwanthTechnovert
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi GoodAfternoon,
I am trying to generate a JWT token in .net 8 using c#. I have a payload with me in the form of JSON array. Is it possible to give this payload as it is instead of converting to your Dictionary<string,object> claims data type in System.IdentityModel.Tokens.Jwt nuget package(which is not possible as it will throw exception).
This is my sample JSON:-
[{
"id": 1,
"first_name": "Cristionna",
"last_name": "Lerigo",
"email": "[email protected]",
"gender": "Agender",
"ip_address": "248.29.27.249"
}, {
"id": 2,
"first_name": "Dee",
"last_name": "Leaney",
"email": "[email protected]",
"gender": "Polygender",
"ip_address": "102.181.150.82"
}, {
"id": 3,
"first_name": "Roda",
"last_name": "Biswell",
"email": "[email protected]",
"gender": "Female",
"ip_address": "20.149.99.253"
}, {
"id": 4,
"first_name": "Maura",
"last_name": "Renackowna",
"email": "[email protected]",
"gender": "Female",
"ip_address": "175.109.32.110"
}, {
"id": 5,
"first_name": "Birch",
"last_name": "Exposito",
"email": "[email protected]",
"gender": "Bigender",
"ip_address": "133.33.159.143"
}]. Also I dont want to create any additional key value pairs.
Kindly please help me out in this regards.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions