new KeyValuePair<string, string>("grant_type","password"),
new KeyValuePair<string, string>("username",username),
new KeyValuePair<string, string>("password",password)
};
var request = new HttpRequestMessage(HttpMethod.Post, "http://somesite.com/Token");
request.Content = new FormUrlEncodedContent(keyValues);
var client = new HttpClient();
var response = await client.SendAsync(request);
var jwt = await response.Content.ReadAsStringAsync();
var jwtDynamic = new JObject();
jwtDynamic = JsonConvert.DeserializeObject<dynamic>(jwt);
//dynamic jwtDynamic = JsonConvert.DeserializeObject(jwt);
var accessToken = jwtDynamic.Value<string>("access_token");
var accessExpires = jwtDynamic.Value<DateTime>(".expires");
Debug.WriteLine(jwt);
return accessToken;
It is breaking at var response