fido2-net-lib icon indicating copy to clipboard operation
fido2-net-lib copied to clipboard

AuthenticationExtensionsClientOutputs not serializing properly

Open MichaelGrafnetter opened this issue 4 years ago • 0 comments

The AuthenticationExtensionsClientOutputs class does not serialize to JSON properly:

var extensions = new AuthenticationExtensionsClientOutputs();
string jsonExtensions = JsonConvert.SerializeObject(extensions);
// jsonExtensions now contains {"appid":false,"authnSel":false,"biometricPerfBounds":false}
// instead of just {}

IMO, properties AppID, AuthenticatorSelection, and BiometricAuthenticatorPerformanceBounds should be defined as bool? instead of bool, as it is in the AuthenticationExtensionsClientInputs class.

Interestingly, AuthenticationExtensionsClientOutputs class already defines these properties with NullValueHandling = NullValueHandling.Ignore, which takes no effect.

I do not want to create a PR for this, as this would be a breaking change for existing code.

MichaelGrafnetter avatar Oct 14 '20 08:10 MichaelGrafnetter