When I execute the following code to get the token, I got the error "SocketException: No connection could be made because the target machine actively refused (ipaddress)". What caused the error? Did I miss something? Thanks.
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("http://localhost:1234");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/x-www-form-urlencoded"));
var body = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("grant_type", "password"),
new KeyValuePair<string, string>("client_id", "client_id"),
new KeyValuePair<string, string>("client_screte", "client_screte"),
new KeyValuePair<string, string>("username", "xyz"),
new KeyValuePair<string, string>("password", "Password"),
new KeyValuePair<string, string>("scope", "scope"),
};
var content = new FormUrlEncodedContent(body);
HttpResponseMessage tokenResponse = await client.PostAsync("/connect/token", content);
}