title: Deserialize GenericXMLSecurityToken from JsonResult
body: <p>When trying to deserialize a GenericXMLSecurityToken from an HTTPResponseMessage I get the following exception:</p>
  
  <blockquote>
    <p>"Could not create an instance of type
    System.IdentityModel.Tokens.SecurityKeyIdentifierClause. Type is an
    interface or abstract class and cannot be instantiated. Path
    'internalTokenReference.assertionId', line 1, position 162."</p>
  </blockquote>
  
  <p>On the server the serialized object is created using </p>
  
  <pre><code>new JsonResult(genericToken)
  </code></pre>
  
  <p>where <code>genericToken</code> is a <code>GenericXmlSecurityToken</code>. On the client side I am using</p>
  
  <pre><code>HttpResponseMessage response = await httpClient.PostAsync("https://localhost:44359/api/TokenService/RequestToken", requestcontent);
  String responseString = await response.Content.ReadAsStringAsync();
  GenericXMLSecurityToken result = JsonConvert.DeserializeObject&lt;GenericXMLSecurityToken&gt;(responseString);
  </code></pre>
  
  <p>however the last line throws an exception with the text above. I understand the error in so much as I know I can't instantiate that type because it's abstract, is there another way I can serialize this type to get around this or is it just not serializable to JSON?</p>