public void UserLogin() { using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Add("Authorization", default_Token); List<KeyValuePair<String, String>> paramList = new List<KeyValuePair<String, String>>(); paramList.Add(new KeyValuePair<string, string>("grant_type", "password")); paramList.Add(new KeyValuePair<string, string>("activationCode", "CloudPeak")); paramList.Add(new KeyValuePair<string, string>("deviceId", "CloudPeak")); var response = client.PostAsync(serverUrl+"/OAuth/Token", new FormUrlEncodedContent(paramList)).Result; var str = response.Content.ReadAsStringAsync().Result; var aa = JObject.Parse(str).ToObject<Dictionary<string, string>>(); string tokenstr = aa["access_token"]; user_Token = "Bearer " + tokenstr; isUserLogin = true; //MessageBox.Show(tokenstr); } }