using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public class AuthResponse
[JsonProperty("AuthenticationResult")]
public AuthenticationResult authenticationResult { get; set; }
public class AuthenticationResult
[JsonProperty("AccessToken")]
public string AccessToken { get; set; }
[JsonProperty("ExpiresIn")]
public int ExpiresIn { get; set; }
[JsonProperty("TokenType")]
public string TokenType { get; set; }
[JsonProperty("RefreshToken")]
public string RefreshToken { get; set; }
[JsonProperty("IdToken")]
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();
settings.ContractResolver = new DefaultContractResolver {
NamingStrategy = new CamelCaseNamingStrategy {
OverrideSpecifiedNames = false
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: ");