using System.Text.Json.Serialization;
public static void Main()
string json = "{ \"access_token\": \"test-token\", \"expires_in\": 1234, \"refresh_token\": \"refresh\", \"scope\": \"identify\", \"token_type\": \"Bearer\" }";
AccessTokenResponse response = JsonSerializer.Deserialize<AccessTokenResponse>(json);
Console.WriteLine(response?.AccessToken);
public class AccessTokenResponse
[JsonPropertyName("access_token")] public string AccessToken { get; set; }
[JsonPropertyName("expires_in")] public int ExpiresIn { get; set; }
[JsonPropertyName("refresh_token")] public string RefreshToken { get; set; }
[JsonPropertyName("scope")] public string Scope { get; set; }
[JsonPropertyName("token_type")] public string TokenType { get; set; }