using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
[JsonObject(NamingStrategyType = typeof(DefaultNamingStrategy))]
public class AuthResponse
[JsonProperty("AuthenticationResult")]
public AuthenticationResult authenticationResult { get; set; }
[JsonObject(NamingStrategyType = typeof(DefaultNamingStrategy))]
public class AuthenticationResult
public string AccessToken { get; set; }
public int ExpiresIn { get; set; }
public string TokenType { get; set; }
public string RefreshToken { get; set; }
public string IdToken { get; set; }
public static void Test()
var AuthResponse = new AuthResponse
authenticationResult = new() { AccessToken = "foo", ExpiresIn = 1, TokenType = "foo", RefreshToken = "foo", IdToken = "foo" },
var settings = new JsonSerializerSettings
ContractResolver = new CamelCasePropertyNamesContractResolver(),
var json = JsonConvert.SerializeObject(AuthResponse, Formatting.Indented, settings);
public static void Main()
Console.WriteLine("Environment version: {0} ({1}), {2}", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , Environment.Version, Environment.OSVersion);
Console.WriteLine("{0} version: {1}", typeof(JsonSerializer).Namespace, typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");