title: How do I deserialize only a property value from a JSON string?
body: <p>I'm experimenting with JWT auth in a Web API project, and this is the code that fetches the token:</p>
  
  <pre><code>public static async Task Main(string[] args)
  {
      var login = new {username = "mario", password = "secret"};
      var content = new StringContent(JsonConvert.SerializeObject(login), Encoding.UTF8, "application/json");
      var resp = await _client.PostAsync("api/Token", content);
      var json = await resp.Content.ReadAsStringAsync();
  }
  </code></pre>
  
  <p>Yet the end value of <code>json</code> looks something like:</p>
  
  <pre><code>{ "token":"eyJhbGciOiJIUz...AXRbztetz_WhI"}
  </code></pre>
  
  <p>I would like to do something like:</p>
  
  <pre><code>var token = JsonConvert.DeserializeObject&lt;???&gt;(json);
  </code></pre>
  
  <p>but when I use </p>
  
  <pre><code>JsonConvert.DeserializeObject&lt;string&gt;(json)
  </code></pre>
  
  <p>I get a <code>JsonReaderException</code>: </p>
  
  <blockquote>
    <p>Unexpected character encountered while parsing value: {. Path '', line
    1, position 1.</p>
  </blockquote>
  
  <p>Now how do I deserialize that json to get the string value of the <code>token</code> property?</p>