public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var jsonObject = JObject.Load(reader);
            var properties = jsonObject.Properties().ToLookup(x => x.Name.ToLowerInvariant());

            var serializedRegistrationData = properties["registrationdata"].Single().Value.ToString();
            var serializedClientData       = properties["clientdata"].Single().Value.ToString();

            return(new FidoRegisterResponse
            {
                RegistrationData = FidoRegistrationData.FromWebSafeBase64(serializedRegistrationData),
                ClientData = FidoClientData.FromWebSafeBase64(serializedClientData)
            });
        }
Пример #2
0
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     return(FidoClientData.FromWebSafeBase64(reader.Value.ToString()));
 }