title: Read Facebook Claims - Is this a good approach?
body: <p>I'm trying to read FB claims after authenticating the user. This is my code so far:</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; ExternalLoginCallback(string returnUrl)
  {
      var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
      var externalIdentity = HttpContext.GetOwinContext().Authentication.GetExternalIdentityAsync(DefaultAuthenticationTypes.ExternalCookie);
  
      dynamic emailClaim = JsonConvert.DeserializeObject(externalIdentity.Result.Claims.Single(c =&gt; c.Type == ClaimTypes.Email).Value);
      dynamic locationClaim = JsonConvert.DeserializeObject(externalIdentity.Result.Claims.Single(c =&gt; c.Type == "urn:facebook:location").Value);
      dynamic genderClaim = JsonConvert.DeserializeObject(externalIdentity.Result.Claims.Single(c =&gt; c.Type == "urn:facebook:gender").Value);
      dynamic firstNameClaim = JsonConvert.DeserializeObject(externalIdentity.Result.Claims.Single(c =&gt; c.Type == "urn:facebook:first_name").Value);
      dynamic birthdateClaim = JsonConvert.DeserializeObject(externalIdentity.Result.Claims.Single(c =&gt; c.Type == "urn:facebook:birthday").Value);
  
      var email = emailClaim.email;
      var city = locationClaim.name.ToString().Split(',')[0];
      var country = locationClaim.name.ToString().Split(',')[1];
  
      var gender = genderClaim.gender;
      var firstname = firstNameClaim.first_name;
      var birthdate = DateTime.ParseExact(birthdateClaim.birthday, "MM/dd/yyyy", CultureInfo.InvariantCulture);
  </code></pre>
  
  <p>As you can see, I'm converting FB claims into a dynamic object so I can later reference it easier.</p>
  
  <p>Do you think this is a good approach? I'm planning to read the provider and apply strategy pattern to encapsulate this logic. Sounds good for you? Or should I refactor to something else?</p>