I am having a lot of difficulty with a failing unit test. Specifically,
JwtRequestAuthorizeTests.authorize_should_accept_complex_objects_in_request_object()
The test attempts to add an Object parameter to the Claims array, and it is failing because after the request goes through the pipeline, an expected parameter called "someObj" is missing.
For the record, someObj is simply a json object defined as:
{{
"foo": {
"bar": "bar"
},
"baz": "baz"
}}
Also for the record, when I pull the latest IdentityServer code from GitHub the test passes.
I've discovered that the reason it's failing is because in the method JwtRequestValidator.ProcessPayloadAsync(JwtSecurityToken token), the variable value is of a type different than what's expected. Specifically, the code thinks it's Microsoft.IdentityModel.Json.Linq.JObject when it should be Newtonsoft.Json.Linq.JObject. I can't for the life of me figure out how or why this is the case.
I've included this image to show you that I'm not crazy (or at least, why I don't think I'm crazy). You can see that the cast from value to JObject fails, as jobj = null, and you can also see that value.GetType() returns Microsoft.IdentityModel.Json.Linq.JObject.
So can StackOverflow please tell me why this is happening, and perhaps how I can fix it?
Also, I think it's worth noting that I'm referencing Newtonsoft.Json as it should be:


