IdentityServer4.Endpoints.Results.TokenResult throws exception (for some users only)
Hello
May I ask for a short look and a hint what is going wrong here? Many thanks in advance!
Get this exception for some users in our database:
2019-03-11 12:30:32.5384 [75] FATAL IdentityServer4.Hosting.IdentityServerMiddleware - Unhandled exception: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. System.### NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei IdentityServer4.Extensions.DictionaryExtensions.AddDictionary(JObject jobject, Dictionary`2 dictionary)
bei IdentityServer4.Endpoints.Results.TokenResult.

Exception origin is somewhere here i think.
Related to Response.Custom field?? When do we expect this field to be set??
Many thanks for any hint!
Response.Custom is not set by us anywhere. You must use some extensibility point somewhere and set it?!
Found the issue:
In our LoginValidator we add some custom data to the dictionary, like: customResponse.Add("CultureInfoCode", user.CultureInfoCode);
When user.CultureInfoCode is NULL in this case the exception is thrown during the AddDictionary call
Maybe there should be a possibility to have null values here??
Only a hint. Not important for me now!
Many thanks!
How about you check for null? ;)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.